Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CounterNameTable = *QueryNameTable("Counter 009")
CounterNameTable Initialize global name tables profiling, add option to disable name tables if necessary Not sure if we should resolve the names at all or just have the caller do it on demand (for many use cases the index is sufficient)
Functions ¶
func MapCounterToIndex ¶
Types ¶
type NameTable ¶
type NameTable struct {
// contains filtered or unexported fields
}
func QueryNameTable ¶
QueryNameTable Query a perflib name table from the v1. Specify the type and the language code (i.e. "Counter 009" or "Help 009") for English language.
func (*NameTable) LookupIndex ¶
func (*NameTable) LookupString ¶
type PerfCounter ¶
type PerfCounter struct { Value int64 Def *PerfCounterDef SecondValue int64 }
type PerfCounterDef ¶
type PerfCounterDef struct { Name string NameIndex uint // For debugging - subject to removal. CounterType is a perflib // implementation detail (see perflib.h) and should not be used outside // of this package. We export it so we can show it on /dump. CounterType uint32 // PERF_TYPE_COUNTER (otherwise, it's a gauge) IsCounter bool // PERF_COUNTER_BASE (base value of a multi-value fraction) IsBaseValue bool // PERF_TIMER_100NS IsNanosecondCounter bool HasSecondValue bool // contains filtered or unexported fields }
type PerfInstance ¶
type PerfInstance struct { // *not* resolved using a name table Name string Counters []*PerfCounter // contains filtered or unexported fields }
PerfInstance Each object can have multiple instances. For example, In case the object has no instances, we return one single PerfInstance with an empty name.
type PerfObject ¶
type PerfObject struct { Name string // NameIndex Same index you pass to QueryPerformanceData NameIndex uint Instances []*PerfInstance CounterDefs []*PerfCounterDef Frequency int64 // contains filtered or unexported fields }
PerfObject Top-level performance object (like "Process").
func QueryPerformanceData ¶
func QueryPerformanceData(query string, counterName string) ([]*PerfObject, error)
QueryPerformanceData Query all performance counters that match a given query.
The query can be any of the following:
- "Global" (all performance counters except those Windows marked as costly)
- "Costly" (only the costly ones)
- One or more object indices, separated by spaces ("238 2 5")
Many objects have dependencies - if you query one of them, you often get back more than you asked for.