model

package
v0.0.0-...-9fcd7d3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KEY_TRACE_ID = "traceId"
	// 突变Span
	KEY_SPAN_ID = "spanId"
	// 突变类型
	KEY_CPU_TYPE = "cpuType"
)

Variables

View Source
var CPUTypes = [CPUTYPE_MAX]string{
	CPUType_ON:    "cpu",
	CPUType_FILE:  "file",
	CPUType_NET:   "net",
	CPUType_FUTEX: "futex",
	CPUType_IDLE:  "idle",
	CPUType_OTHER: "other",
	CPUType_EPOLL: "epoll",
	CPUType_RUNQ:  "runq",
}

Functions

func String2Bytes

func String2Bytes(s string) []byte

Types

type AggregatedTime

type AggregatedTime struct {
	// on, file, net, futex, idle, other, epoll
	Times [CPUTYPE_MAX]uint64
}

type AttributeMap

type AttributeMap struct {
	// contains filtered or unexported fields
}

func NewAttributeMap

func NewAttributeMap() *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) 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) HasAttribute

func (a *AttributeMap) HasAttribute(key string) bool

func (AttributeMap) MarshalJSON

func (a AttributeMap) MarshalJSON() ([]byte, error)

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

type AttributeValue

type AttributeValue interface {
	Type() AttributeValueType
	ToString() string
}

type AttributeValueType

type AttributeValueType int
const (
	StringAttributeValueType AttributeValueType = iota
	IntAttributeValueType
	BooleanAttributeValueType
)

type CPUType

type CPUType uint8
const (
	CPUType_ON    CPUType = 0
	CPUType_FILE  CPUType = 1
	CPUType_NET   CPUType = 2
	CPUType_FUTEX CPUType = 3
	CPUType_IDLE  CPUType = 4
	CPUType_OTHER CPUType = 5
	CPUType_EPOLL CPUType = 6
	CPUType_RUNQ  CPUType = 7
	CPUTYPE_MAX   CPUType = 8
)

type CameraEventGroup

type CameraEventGroup struct {
	Timestamp uint64           `json:"timestamp"`
	Labels    CameraEventLabel `json:"labels"`
}

type CameraEventLabel

type CameraEventLabel struct {
	ContentKey      string `json:"content_key"`
	CpuEvents       string `json:"cpuEvents"`
	JavaFutexEvents string `json:"javaFutexEvents"`
	TransactionIds  string `json:"transactionIds"`
	OffsetTs        int64  `json:"offset_ts"`
}

type CpuEvent

type CpuEvent struct {
	StartTime   uint64    `json:"startTime"`
	EndTime     uint64    `json:"endTime"`
	TypeSpecs   []uint64  `json:"typeSpecs"`
	RunqLatency []uint64  `json:"runqLatency"`
	TimeType    []CPUType `json:"timeType"`
	OnInfo      string    `json:"onInfo"`
	OffInfo     string    `json:"offInfo"`
	Log         string    `json:"log"`
	Stack       string    `json:"stack"`
}

type JavaFutexEvent

type JavaFutexEvent struct {
	StartTime uint64 `json:"startTime"`
	EndTime   uint64 `json:"endTime"`
	DataVal   string `json:"dataValue"`
}

type Profiles

type Profiles struct {
	// Trace开始时间
	StartTime uint64
	// Trace结束时间
	EndTime uint64
	// 汇总时间分布
	AggTime AggregatedTime
	// 存储所有CPUEvents
	CpuEvents []*CpuEvent
	// 存储所有FutexEvents
	Futexs []*JavaFutexEvent

	OffsetTs []int64
}

func NewProfiles

func NewProfiles(startTime uint64, endTime uint64) *Profiles

func (*Profiles) AddCpuEvents

func (p *Profiles) AddCpuEvents(events []*CpuEvent)

func (*Profiles) AddFutexEvents

func (p *Profiles) AddFutexEvents(events []*JavaFutexEvent)

func (*Profiles) CalcProfileEventMetrics

func (p *Profiles) CalcProfileEventMetrics()

CalcProfileEventMetrics 计算北极星指标

func (*Profiles) ToString

func (profiles *Profiles) ToString() string

type SpanTraceGroup

type SpanTraceGroup struct {
	Timestamp uint64         `json:"timestamp"`
	Labels    SpanTraceLabel `json:"labels"`
}

type SpanTraceLabel

type SpanTraceLabel struct {
	Pid           uint64  `json:"pid"`
	Tid           uint64  `json:"tid"`
	ApmType       string  `json:"apm_type"`
	ApmSpantId    string  `json:"apm_span_id"`
	ContentKey    string  `json:"content_key"`
	EndTime       uint64  `json:"end_time"`
	Duration      uint64  `json:"duration"`
	P90           float64 `json:"p90"`
	TraceId       string  `json:"trace_id"`
	ContainerId   string  `json:"container_id"`
	ContainerName string  `json:"container_name"`
	WorkloadName  string  `json:"workload_name"`
	WorkloadKind  string  `json:"workload_kind"`
	PodIp         string  `json:"pod_ip"`
	PodName       string  `json:"pod_name"`
	Namespace     string  `json:"namespace"`
	IsProfiled    bool    `json:"is_profiled"`
	IsError       bool    `json:"is_error"`
	IsSlow        bool    `json:"is_slow"`
	NodeName      string  `json:"node_name"`
	NodeIp        string  `json:"node_ip"`
	OffsetTs      int64   `json:"offset_ts"`
}

type Trace

type Trace struct {
	Pid           uint64
	Tid           uint64
	ApmType       string
	ApmSpanId     string
	Url           string
	ContainerId   string
	ContainerName string
	WorkloadName  string
	WorkloadKind  string
	PodIp         string
	PodName       string
	Namespace     string
	StartTime     uint64
	EndTime       uint64
	P90           uint64
	IsProfiled    bool
	NodeName      string
	NodeIp        string
	OffsetTs      int64
}

func NewTrace

func NewTrace(group *SpanTraceGroup) *Trace

func (*Trace) GetDuration

func (trace *Trace) GetDuration() uint64

type Traces

type Traces struct {
	TraceId string
	Traces  []*Trace
}

func NewTraces

func NewTraces(traceId string) *Traces

func (*Traces) AddTrace

func (traces *Traces) AddTrace(trace *Trace) bool

func (*Traces) GetSpanIds

func (traces *Traces) GetSpanIds() []string

func (*Traces) ToString

func (traces *Traces) ToString() string

type TransactionIdEvent

type TransactionIdEvent struct {
	Timestamp uint64 `json:"timestamp"`
	TraceId   string `json:"traceId"`
	IsEntry   uint32 `json:"isEntry"`
}

Jump to

Keyboard shortcuts

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