Documentation
¶
Index ¶
- Constants
- func AdjustThreadPolicies(threads *ThreadList, policies []ThreadPolicy)
- func GetJstackThreadDump(java_home string, pid string) (string, error)
- func GetThreadDump(pid string) (string, error)
- func RescheduleThreadGroup(threads *ThreadList) error
- func SetAffinity(pid int, cpus []int) error
- func SetAffinityThreadGroup(threads *ThreadList) error
- func SetPriorityThreadGroup(threads *ThreadList) error
- type CpuPool
- type Thread
- type ThreadList
- type ThreadPolicy
- type ThreadPolicyArgList
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 GetThreadDump ¶
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 ¶
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 NewEmptyCpuPool ¶
func NewEmptyCpuPool() CpuPool
func ParseCpuPool ¶
type 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 ¶
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
Click to show internal directories.
Click to hide internal directories.