jscheduler

package
v0.0.0-...-839d904 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2016 License: EPL-1.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const THREAD_DESCRIPTOR1 string = `` /* 127-byte string literal not displayed */
View Source
const THREAD_DESCRIPTOR2 string = `^"(?P<name>[^"]+)"\s+os_prio=(?P<os_prio>[0-9]+)\s+tid=(?P<tid>0x[0-9a-f]+)\s+nid=(?P<nid>0x[0-9a-f]+).+`

Variables

This section is empty.

Functions

func AdjustThreadPolicies

func AdjustThreadPolicies(threads *ThreadList, policies []ThreadPolicy)

func GetJstackThreadDump

func GetJstackThreadDump(java_home string, pid string) (string, error)

func GetThreadDump

func GetThreadDump(pid string) (string, error)

Take a thread dump with JStack TODO: Can be done natively with syscall.Kill(pid, SIGQUIT) if we find a way to capture the output

func RescheduleThreadGroup

func RescheduleThreadGroup(threads *ThreadList) error

func SetAffinity

func SetAffinity(pid int, cpus []int) error

SetAffinity attend the cpu list to pid, note: SetAffinity apply to thread ID only, to fully control one process, call SetAffinity for all thread of the process. use os.GetThreadIDs() to get all thread of the process check ghttps://github.com/golang/go/issues/11243

func SetAffinityThreadGroup

func SetAffinityThreadGroup(threads *ThreadList) error

func SetPriorityThreadGroup

func SetPriorityThreadGroup(threads *ThreadList) error

Types

type CpuPool

type CpuPool []int

func NewCpuPool

func NewCpuPool(numCpus int) CpuPool

func NewEmptyCpuPool

func NewEmptyCpuPool() CpuPool

func ParseCpuPool

func ParseCpuPool(pool string) CpuPool

type Thread

type Thread struct {
	Name      string
	Tid       int
	Prio      int
	Cpus      CpuPool
	HasPolicy bool
}

func NewThread

func NewThread(name string, tid int) Thread

func (*Thread) FilterAndSetPolicy

func (t *Thread) FilterAndSetPolicy(policy ThreadPolicy)

func (*Thread) SetPolicy

func (t *Thread) SetPolicy(policy ThreadPolicy)

type ThreadList

type ThreadList []Thread

func NewThreadList

func NewThreadList() ThreadList

func ParseThreadDump

func ParseThreadDump(threadDump string, excluded map[string]struct{}) (*ThreadList, error)

Parse a Java thread dump taken with JStack (or with SIGQUIT)

type ThreadPolicy

type ThreadPolicy struct {
	Filter string
	Prio   int
	Cpus   CpuPool
}

func NewThreadPolicy

func NewThreadPolicy() ThreadPolicy

type ThreadPolicyArgList

type ThreadPolicyArgList struct {
	Value []ThreadPolicy
}

func NewThreadPolicyArgList

func NewThreadPolicyArgList() ThreadPolicyArgList

func (*ThreadPolicyArgList) Get

func (lst *ThreadPolicyArgList) Get() []ThreadPolicy

func (*ThreadPolicyArgList) IsSet

func (lst *ThreadPolicyArgList) IsSet() bool

func (*ThreadPolicyArgList) Set

func (lst *ThreadPolicyArgList) Set(s string) error

func (*ThreadPolicyArgList) String

func (lst *ThreadPolicyArgList) String() string

Jump to

Keyboard shortcuts

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