ps

package module
v0.0.0-...-b3e1b4a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2017 License: BSD-3-Clause Imports: 3 Imported by: 0

README

Windows jobs.

See http://godoc.org/github.com/alexbrainman/ps for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobObject

type JobObject struct {
	Handle syscall.Handle
}

JobObject

func CreateJobObject

func CreateJobObject(name string) (*JobObject, error)

CreateJobObject creates new job object named name.

func OpenJobObject

func OpenJobObject(name string, access uint32) (*JobObject, error)

OpenJobObject opens existing job object named name.

func (*JobObject) AddCurrentProcess

func (jo *JobObject) AddCurrentProcess() error

AddCurrentProcess adds current process to job object jo.

func (*JobObject) AddProcess

func (jo *JobObject) AddProcess(p syscall.Handle) error

AddProcess adds process idntified by process handle p to job object jo.

func (*JobObject) Close

func (jo *JobObject) Close() error

Close closes job object handle. The job is destroyed when its last handle has been closed and all associated processes have exited.

func (*JobObject) Monitor

func (jo *JobObject) Monitor() (*JobObjectMonitor, error)

Monitor creates new event monitor for job object jo.

func (*JobObject) Terminate

func (jo *JobObject) Terminate(exitcode uint32) error

type JobObjectMonitor

type JobObjectMonitor struct {
	Handle syscall.Handle
	// contains filtered or unexported fields
}

JobObjectMonitor job objects events (like new process started or existing process ended).

func (*JobObjectMonitor) Close

func (m *JobObjectMonitor) Close() error

Close releases monitor resources.

func (*JobObjectMonitor) GetEvent

func (m *JobObjectMonitor) GetEvent() (uint32, uintptr, error)

GetEvent waits for next m's event. Return parameters are event specific - see source code for details.

type Process

type Process struct {
	Handle syscall.Handle // process handle
	// contains filtered or unexported fields
}

Process is used to query process statistics

func OpenCurrent

func OpenCurrent() (*Process, error)

OpenCurrent establishes access to current OS process.

func OpenProcess

func OpenProcess(pid int) (*Process, error)

OpenProcess establishes access to OS process idenified by pid.

func (*Process) Close

func (p *Process) Close() error

Close closes process handle.

func (*Process) Stats

func (p *Process) Stats() (*ProcessStats, error)

Stats retrieves CPU and memory usage for process p. Stats can be used even for a completed process.

type ProcessStats

type ProcessStats struct {
	CPU    syscall.Rusage
	Memory winapi.PROCESS_MEMORY_COUNTERS
}

ProcessStats stores process statistics.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL