model

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RefTypeChildOf int8 = iota
	RefTypeFollowsFrom
)

RefType Kind

View Source
const (
	TagString int8 = iota
	TagInt
	TagBool
	TagFloat
)

TagKind

Variables

This section is empty.

Functions

func ParseProtoSpanTag

func ParseProtoSpanTag(protoSpan *protogen.Span) map[string]interface{}

ParseProtoSpanTag tag

Types

type ClientStatus

type ClientStatus struct {
	Addr     string `json:"addr"`
	UpTime   int64  `json:"up_time"`
	ErrCount int64  `json:"err_count"`
	Rate     int64  `json:"rate"`
}

ClientStatus client status

type ClientStatusResp

type ClientStatusResp struct {
	QueueLen int             `json:"queue_len"`
	Clients  []*ClientStatus `json:"clients"`
}

ClientStatusResp response clientstatus request just for debug

type Field

type Field struct {
	Key   string
	Value []byte
}

Field log field

type Log

type Log struct {
	Timestamp int64
	Fields    []Field
}

Log span log

type ProtoSpan

type ProtoSpan protogen.Span

ProtoSpan alias to tgo-common/library/net/trace/proto.Span

type SamplePoint

type SamplePoint struct {
	TraceID uint64
	SpanID  uint64
	Value   int64
}

SamplePoint SamplePoint

type Span

type Span struct {
	ServiceName   string
	OperationName string
	TraceID       uint64
	SpanID        uint64
	ParentID      uint64
	Env           string
	StartTime     time.Time
	Duration      time.Duration
	References    []SpanRef
	Tags          map[string]interface{}
	Logs          []Log
	ProtoSpan     *ProtoSpan
}

Span represents a named unit of work performed by a service.

func FromProtoSpan

func FromProtoSpan(protoSpan *ProtoSpan, parseLog bool) (*Span, error)

FromProtoSpan convert protogen.Span to model.Span

func (*Span) BoolTag

func (s *Span) BoolTag(key string) bool

BoolTag get string type tag

func (*Span) GetTagString

func (s *Span) GetTagString(key string) string

GetTagString .

func (*Span) IsError

func (s *Span) IsError() bool

IsError is error happend

func (*Span) IsServer

func (s *Span) IsServer() bool

IsServer span kind is server

func (*Span) Marshal

func (s *Span) Marshal() ([]byte, error)

Marshal return

func (*Span) ParentIDStr

func (s *Span) ParentIDStr() string

ParentIDStr return hex format parent_id

func (*Span) SetOperationName

func (s *Span) SetOperationName(operationName string)

SetOperationName .

func (*Span) SetTag

func (s *Span) SetTag(key string, value interface{}) error

SetTag attach tag

func (*Span) SpanIDStr

func (s *Span) SpanIDStr() string

SpanIDStr return hex format span_id

func (*Span) StringTag

func (s *Span) StringTag(key string) string

StringTag get string type tag

func (*Span) TraceIDStr

func (s *Span) TraceIDStr() string

TraceIDStr return hex format trace_id

type SpanPoint

type SpanPoint struct {
	Timestamp     int64
	ServiceName   string
	OperationName string
	PeerService   string
	SpanKind      string
	AvgDuration   SamplePoint // random sample point
	MaxDuration   SamplePoint
	MinDuration   SamplePoint
	Errors        []SamplePoint
}

SpanPoint contains time series

type SpanRef

type SpanRef struct {
	RefType int8
	TraceID uint64
	SpanID  uint64
}

SpanRef describes causal relationship of the current span to another span (e.g. 'child-of')

type Tag

type Tag struct {
	Kind  int8
	Key   string
	Value interface{}
}

Tag span tag

Jump to

Keyboard shortcuts

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