Documentation
¶
Index ¶
- Constants
- Variables
- func GetByteOrder() binary.ByteOrder
- type AttributeMap
- func (a *AttributeMap) AddBoolValue(key string, value bool)
- func (a *AttributeMap) AddIntValue(key string, value int64)
- func (a *AttributeMap) AddStringValue(key string, value string)
- func (a *AttributeMap) ClearAttributes()
- func (a *AttributeMap) Clone() *AttributeMap
- func (a *AttributeMap) GetBoolValue(key string) bool
- func (a *AttributeMap) GetIntValue(key string) int64
- func (a *AttributeMap) GetStringValue(key string) string
- func (a *AttributeMap) GetValues() map[string]AttributeValue
- func (a *AttributeMap) HasAttribute(key string) bool
- func (a *AttributeMap) IsEmpty() bool
- func (a AttributeMap) MarshalJSON() ([]byte, error)
- func (a *AttributeMap) Merge(other *AttributeMap)
- func (a *AttributeMap) RemoveAttribute(key string)
- func (a *AttributeMap) ResetValues()
- func (a *AttributeMap) Size() int
- func (a *AttributeMap) String() string
- func (a *AttributeMap) ToStringMap() map[string]string
- func (a *AttributeMap) UnmarshalJSON(data []byte) error
- func (a *AttributeMap) UpdateAddBoolValue(key string, value bool)
- func (a *AttributeMap) UpdateAddIntValue(key string, value int64)
- func (a *AttributeMap) UpdateAddStringValue(key string, value string)
- type AttributeValue
- type AttributeValueType
- type CPUType
- type CircleQueue
- type ClassInfo
- type CpuEvent
- type DataBlock
- func (d *DataBlock) AddIntMetricWithName(name string, value int64)
- func (d *DataBlock) AddMetric(metric *Metric)
- func (d *DataBlock) Clone() *DataBlock
- func (d *DataBlock) GetMetric(name string) (*Metric, bool)
- func (d *DataBlock) RemoveMetric(name string)
- func (d *DataBlock) Reset()
- func (d DataBlock) String() string
- func (d *DataBlock) UpdateAddIntMetric(name string, value int64)
- type EventData
- type Histogram
- type IP
- type Int
- type KeyValue
- type Metric
- type MetricType
- type NetInfo
- type Protocol
- type Segment
- type SpyEvent
- func (s *SpyEvent) GetComm() string
- func (s *SpyEvent) GetIntUserAttribute(key string) int64
- func (s *SpyEvent) GetPid() uint32
- func (s *SpyEvent) GetTid() uint32
- func (s *SpyEvent) GetUintUserAttribute(key string) uint64
- func (s *SpyEvent) GetUserAttribute(key string) *KeyValue
- func (s *SpyEvent) GetUserAttributes() *[SpyEventFieldMax]KeyValue
- func (s *SpyEvent) SetUserAttribute(kv KeyValue) error
- func (s *SpyEvent) SetUserAttributeWithByteBuf(key string, value []byte)
- func (s *SpyEvent) SetUserAttributeWithInt32(key string, value int32)
- func (s *SpyEvent) SetUserAttributeWithInt64(key string, value int64)
- func (s *SpyEvent) SetUserAttributeWithUint32(key string, value uint32)
- func (s *SpyEvent) SetUserAttributeWithUint64(key string, value uint64)
- type TaskInfo
- type TimeSegments
- type TimedEvent
- type TimedEventKind
- type ValueType
Constants ¶
View Source
const ( LOKI = "loki" PROMETHEUS = "prometheus" DISK = "disk" INFLUXDB = "influxdb" PYROSCOPE = "pyroscope" )
expoter type
View Source
const ( OffCpu = "offcpu" IrqOff = "irqoff" OnCpu = "oncpu" FutexSnoop = "futexsnoop" Syscall = "syscall" OtherEvent = "other_event" )
View Source
const ( OffCpuMetricName = "offcpu_dur_ms" FutexMaxUerCountName = "max_futex_user_cnt" )
for metric
View Source
const ( Comm = "comm" Pid = "pid" Tid = "tid" StartTime = "start_ts" EndTime = "end_ts" IsSent = "isSent" ThreadName = "threadName" TimeStamp = "ts" Tid_W = "waker_tid" Pid_W = "waker_pid" Waker = "waker" Wakee = "wakee" Cpu = "cpu" Prio = "prio" CacheId = "cache_id" WTarget = "wtarget" Pid_WT = "pid_wt" Tid_WT = "tid_wt" Target = "target" Pid_T = "wakee_pid" Tid_T = "wakee_tid" IrqOffUs_W = "wakee_irqoff_us" CpuOffUs_W = "waker_offcpu_us" RunqLatUs_W = "waker_runqlat_us" Stack_W = "waker_stack" IrqOffUs_T = "wakee_irqoff_us" CpuOffUs_T = "wakee_offcpu_us" RunqLatUs_T = "wakee_runqlat_us" Stack_T = "wakee_stack" RunqDurMs = "rq_dur_ms" // for futexsnoop UserCnt = "user_cnt" MaxUserCnt = "max_user_cnt" LockAddr = "lock_addr" MinDur = "min_dur" MaxDur = "max_dur" DeltaDur = "delta_dur" AvgDur = "avg_dur" LockCnt = "lock_cnt" Stack = "stack" // for syscall DurMs = "dur_ms" DurUs = "dur_us" )
for labels
View Source
const ( ProtoUnknown = 0 ProtoTcp = 1 ProtoUdp = 2 ProtoIcmp = 3 ProtoRaw = 4 )
View Source
const (
CpuEventBlockName = "cpu_event_block"
)
View Source
const (
CpuEventLabel = "cpuEvents"
)
View Source
const (
SpyEventFieldMax int = 20
)
Variables ¶
View Source
var (
ByteOrder = GetByteOrder()
)
View Source
var ValueType_name = map[int32]string{
0: "NONE",
1: "INT8",
2: "INT16",
3: "INT32",
4: "INT64",
5: "UINT8",
6: "UINT16",
7: "UINT32",
8: "UINT64",
9: "CHARBUF",
10: "BYTEBUF",
11: "FLOAT",
12: "DOUBLE",
13: "BOOL",
}
View Source
var ValueType_value = map[string]int32{
"NONE": 0,
"INT8": 1,
"INT16": 2,
"INT32": 3,
"INT64": 4,
"UINT8": 5,
"UINT16": 6,
"UINT32": 7,
"UINT64": 8,
"CHARBUF": 9,
"BYTEBUF": 10,
"FLOAT": 11,
"DOUBLE": 12,
"BOOL": 13,
}
Functions ¶
func GetByteOrder ¶
Types ¶
type AttributeMap ¶
type AttributeMap struct {
// contains filtered or unexported fields
}
func NewAttributeMap ¶
func NewAttributeMap() *AttributeMap
func NewAttributeMapWithValues ¶
func NewAttributeMapWithValues(values map[string]AttributeValue) *AttributeMap
func (*AttributeMap) AddBoolValue ¶
func (a *AttributeMap) AddBoolValue(key string, value bool)
func (*AttributeMap) AddIntValue ¶
func (a *AttributeMap) AddIntValue(key string, value int64)
func (*AttributeMap) AddStringValue ¶
func (a *AttributeMap) AddStringValue(key string, value string)
func (*AttributeMap) ClearAttributes ¶
func (a *AttributeMap) ClearAttributes()
func (*AttributeMap) Clone ¶
func (a *AttributeMap) Clone() *AttributeMap
func (*AttributeMap) GetBoolValue ¶
func (a *AttributeMap) GetBoolValue(key string) bool
func (*AttributeMap) GetIntValue ¶
func (a *AttributeMap) GetIntValue(key string) int64
func (*AttributeMap) GetStringValue ¶
func (a *AttributeMap) GetStringValue(key string) string
func (*AttributeMap) GetValues ¶
func (a *AttributeMap) GetValues() map[string]AttributeValue
func (*AttributeMap) HasAttribute ¶
func (a *AttributeMap) HasAttribute(key string) bool
func (*AttributeMap) IsEmpty ¶
func (a *AttributeMap) IsEmpty() bool
func (AttributeMap) MarshalJSON ¶
func (a AttributeMap) MarshalJSON() ([]byte, error)
func (*AttributeMap) Merge ¶
func (a *AttributeMap) Merge(other *AttributeMap)
func (*AttributeMap) RemoveAttribute ¶
func (a *AttributeMap) RemoveAttribute(key string)
func (*AttributeMap) ResetValues ¶
func (a *AttributeMap) ResetValues()
ResetValues sets the default value for all elements. Used for implementing sync.Pool.
func (*AttributeMap) Size ¶
func (a *AttributeMap) Size() int
func (*AttributeMap) String ¶
func (a *AttributeMap) String() string
func (*AttributeMap) ToStringMap ¶
func (a *AttributeMap) ToStringMap() map[string]string
func (*AttributeMap) UnmarshalJSON ¶
func (a *AttributeMap) UnmarshalJSON(data []byte) error
func (*AttributeMap) UpdateAddBoolValue ¶
func (a *AttributeMap) UpdateAddBoolValue(key string, value bool)
func (*AttributeMap) UpdateAddIntValue ¶
func (a *AttributeMap) UpdateAddIntValue(key string, value int64)
func (*AttributeMap) UpdateAddStringValue ¶
func (a *AttributeMap) UpdateAddStringValue(key string, value string)
type AttributeValue ¶
type AttributeValue interface { Type() AttributeValueType ToString() string Reset() }
func NewBoolValue ¶
func NewBoolValue(value bool) AttributeValue
func NewIntValue ¶
func NewIntValue(value int64) AttributeValue
func NewStringValue ¶
func NewStringValue(value string) AttributeValue
type AttributeValueType ¶
type AttributeValueType int
const ( StringAttributeValueType AttributeValueType = iota IntAttributeValueType BooleanAttributeValueType )
type CPUType ¶
type CPUType uint8
const (
CPUType_ON CPUType = 0
)
func (CPUType) MarshalJSON ¶
func (*CPUType) UnmarshalJSON ¶
type CircleQueue ¶
type CircleQueue struct {
// contains filtered or unexported fields
}
func NewCircleQueue ¶
func NewCircleQueue(length int) *CircleQueue
func (*CircleQueue) Clear ¶
func (s *CircleQueue) Clear()
func (*CircleQueue) GetByIndex ¶
func (s *CircleQueue) GetByIndex(index int) interface{}
func (*CircleQueue) UpdateByIndex ¶
func (s *CircleQueue) UpdateByIndex(index int, val interface{})
type CpuEvent ¶
type CpuEvent struct { TimeStamp uint64 StartTime uint64 EndTime uint64 Waker string Pid_W uint32 Target string Pid_WT uint32 WTarget string Pid_T uint32 IrqOffUs_W uint32 CpuOffUs_W uint32 RunLatUs_W uint32 Stack_W string IrqOffUs_T uint32 CpuOffUs_T uint32 RunLatUs_T uint32 Stack_T string Log string DurMs uint32 RunqDurMs uint32 }
func (*CpuEvent) EndTimestamp ¶
func (*CpuEvent) Kind ¶
func (c *CpuEvent) Kind() TimedEventKind
func (*CpuEvent) StartTimestamp ¶
type DataBlock ¶
type DataBlock struct { Name string `json:"name"` Metrics []*Metric `json:"metrics"` Labels *AttributeMap `json:"labels"` Timestamp uint64 `json:"timestamp"` }
func NewDataBlock ¶
func NewDataBlock(name string, labels *AttributeMap, timestamp uint64, values ...*Metric) *DataBlock
func (*DataBlock) AddIntMetricWithName ¶
func (*DataBlock) RemoveMetric ¶
func (*DataBlock) UpdateAddIntMetric ¶
UpdateAddIntMetric overwrite the metric with the key of 'name' if existing, or adds the metric if not existing.
type KeyValue ¶
func (*KeyValue) GetIntValue ¶
func (*KeyValue) GetUintValue ¶
func (*KeyValue) GetValueType ¶
type Metric ¶
type Metric struct { Name string // Data can be assigned by: // Int // Histogram Data isMetricData }
func NewHistogramMetric ¶
func NewIntMetric ¶
func (*Metric) DataType ¶
func (i *Metric) DataType() MetricType
func (*Metric) GetHistogram ¶
type MetricType ¶
type MetricType int
const ( IntMetricType MetricType = iota HistogramMetricType NoneMetricType )
type Segment ¶
type Segment struct { StartTime uint64 `json:"startTime"` EndTime uint64 `json:"endTime"` CpuEvents []TimedEvent `json:"cpuEvents"` IsSend int IndexTimestamp string `json:"indexTimestamp"` }
func NewSegment ¶
func (*Segment) PutTimedEvent ¶
func (s *Segment) PutTimedEvent(event TimedEvent)
func (*Segment) UnmarshalJSON ¶
type SpyEvent ¶
type SpyEvent struct { Name string TimeStamp uint64 Class ClassInfo Task TaskInfo // UserAttributes 数量 ParamsCnt uint16 UserAttributes [SpyEventFieldMax]KeyValue }
func (*SpyEvent) GetIntUserAttribute ¶
func (*SpyEvent) GetUintUserAttribute ¶
func (*SpyEvent) GetUserAttribute ¶
func (*SpyEvent) GetUserAttributes ¶
func (s *SpyEvent) GetUserAttributes() *[SpyEventFieldMax]KeyValue
func (*SpyEvent) SetUserAttribute ¶
func (*SpyEvent) SetUserAttributeWithByteBuf ¶
func (*SpyEvent) SetUserAttributeWithInt32 ¶
func (*SpyEvent) SetUserAttributeWithInt64 ¶
func (*SpyEvent) SetUserAttributeWithUint32 ¶
func (*SpyEvent) SetUserAttributeWithUint64 ¶
type TimeSegments ¶
type TimeSegments struct { Pid uint32 `json:"pid"` Tid uint32 `json:"tid"` ThreadName string `json:"threadName"` BaseTime uint64 `json:"baseTime"` Segments *CircleQueue `json:"segments"` }
func (*TimeSegments) UpdateThreadName ¶
func (t *TimeSegments) UpdateThreadName(threadName string)
type TimedEvent ¶
type TimedEvent interface { StartTimestamp() uint64 EndTimestamp() uint64 Kind() TimedEventKind }
type ValueType ¶
type ValueType int32
const ( ValueType_NONE ValueType = 0 ValueType_INT8 ValueType = 1 ValueType_INT16 ValueType = 2 ValueType_INT32 ValueType = 3 ValueType_INT64 ValueType = 4 ValueType_UINT8 ValueType = 5 ValueType_UINT16 ValueType = 6 ValueType_UINT32 ValueType = 7 ValueType_UINT64 ValueType = 8 ValueType_CHARBUF ValueType = 9 ValueType_BYTEBUF ValueType = 10 ValueType_FLOAT ValueType = 11 ValueType_DOUBLE ValueType = 12 ValueType_BOOL ValueType = 13 )
Click to show internal directories.
Click to hide internal directories.