agent

package
v0.0.0-...-c93e207 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectPStateMessage

func CollectPStateMessage(getMaxAvr GetMaxAvg, getReqTimeCounter GetReqTimeCounter) *v1.PStatMessage

func GetAgentInfo

func GetAgentInfo(span *TSpan) (appid, name string, appServerType int32, startTime string, err error)

Types

type AgentRouter

type AgentRouter struct {
	AgentMap map[string]*GrpcAgent
	PingId   int32
	Quit     chan bool
	WG       *sync.WaitGroup
	// contains filtered or unexported fields
}

func (*AgentRouter) Clean

func (manager *AgentRouter) Clean()

func (*AgentRouter) DispatchPacket

func (manager *AgentRouter) DispatchPacket(packet *RawPacket) error

type Filter

type Filter interface {
	Interceptor(span *TSpan) bool
}

type GetMaxAvg

type GetMaxAvg func() (max, avg uint32)

type GetReqTimeCounter

type GetReqTimeCounter func() [4]uint16

type GrpcAgent

type GrpcAgent struct {
	AgentId string

	StartTime string
	BaseMD    metadata.MD

	PingId int32

	AgentOnLine bool

	ExitCh chan bool
	// contains filtered or unexported fields
}

func (*GrpcAgent) AddFilter

func (agent *GrpcAgent) AddFilter(filter Filter)

func (*GrpcAgent) CheckValid

func (agent *GrpcAgent) CheckValid(span *TSpan) bool

func (*GrpcAgent) GetLastBusyTime

func (agent *GrpcAgent) GetLastBusyTime() int64

func (*GrpcAgent) Init

func (agent *GrpcAgent) Init(id, _name string, _type int32, StartTime string)

func (*GrpcAgent) Interceptor

func (agent *GrpcAgent) Interceptor(_ *TSpan) bool

func (*GrpcAgent) SendSpan

func (agent *GrpcAgent) SendSpan(span *TSpan)

func (*GrpcAgent) Start

func (agent *GrpcAgent) Start()

func (*GrpcAgent) Stop

func (agent *GrpcAgent) Stop()

func (*GrpcAgent) String

func (agent *GrpcAgent) String() string

type I_PacketRouter

type I_PacketRouter interface {
	DispatchPacket(*RawPacket) error
	Clean()
}

type I_SendMeta

type I_SendMeta interface {
	SenderGrpcMetaData(name string, id int32, Type int32, params PARAMS_TYPE) error
}

type MetaData

type MetaData struct {
	MetaDataType int32
	IDMap        PARAMS_TYPE
	Sender       I_SendMeta
}

func (*MetaData) GetId

func (meta *MetaData) GetId(name string, params PARAMS_TYPE) int32

func (*MetaData) ResetMeta

func (meta *MetaData) ResetMeta()

type PARAMS_TYPE

type PARAMS_TYPE map[string]int32

type RawPacket

type RawPacket struct {
	Type    uint32
	RawData []byte
}

type RequestProfiler

type RequestProfiler struct {
	CTime int64
	// contains filtered or unexported fields
}

func (*RequestProfiler) GetMaxAvg

func (reqProf *RequestProfiler) GetMaxAvg() (max, avg uint32)

func (*RequestProfiler) GetReqTimeProfiler

func (reqProf *RequestProfiler) GetReqTimeProfiler() [4]uint16

func (*RequestProfiler) Interceptor

func (reqProf *RequestProfiler) Interceptor(span *TSpan) bool

type SpanSender

type SpanSender struct {
	Md     metadata.MD
	ExitCh chan bool
	// contains filtered or unexported fields
}

func (*SpanSender) Init

func (spanSender *SpanSender) Init()

func (*SpanSender) Interceptor

func (spanSender *SpanSender) Interceptor(span *TSpan) bool

func (*SpanSender) SenderGrpcMetaData

func (spanSender *SpanSender) SenderGrpcMetaData(name string, id int32, Type int32, params PARAMS_TYPE) error

func (*SpanSender) Stop

func (spanSender *SpanSender) Stop()

type TErrorInfo

type TErrorInfo struct {
	Msg  string `json:"msg"`
	File string `json:"file"`
	Line int    `json:"line"`
}

type TSpan

type TSpan struct {
	AppServerType         int32        `json:"FT"`
	AppServerTypeV2       int32        `json:":FT"`
	ParentAppServerType   int32        `json:"ptype,string"`
	ParentSpanId          int64        `json:"psid,string"`
	ParentApplicationName string       `json:"pname"`
	StartTime             int64        `json:"S"`
	StartTimeV2           int64        `json:":S"`
	ElapsedTime           int32        `json:"E"`
	ElapsedTimeV2         int32        `json:":E"`
	AppId                 string       `json:"appid"`
	AppIdV2               string       `json:":appid"`
	AppName               string       `json:"appname"`
	AppNameV2             string       `json:":appname"`
	Calls                 []TSpanEvent `json:"calls"`
	Clues                 []string     `json:"clues,omitempty"`
	SpanName              string       `json:"name"`
	SpanId                int64        `json:"sid,string"`
	ServerType            int32        `json:"stp,string"`
	TransactionId         string       `json:"tid"`
	Uri                   string       `json:"uri"`
	UT                    string       `json:"UT,omitempty"`
	EndPoint              string       `json:"server"`
	RemoteAddr            string       `json:"client"`
	AcceptorHost          string       `json:"Ah"`
	ExceptionInfo         string       `json:"EXP,omitempty"`
	ErrorInfo             *TErrorInfo  `json:"ERR,omitempty"`
	NginxHeader           string       `json:"NP,omitempty"`
	ApacheHeader          string       `json:"AP,omitempty"`
}

func (*TSpan) FindHistogramLevel

func (span *TSpan) FindHistogramLevel() int

note FindHistogramLevel must come with histogramSize

func (*TSpan) GetAppName

func (span *TSpan) GetAppName() string

func (*TSpan) GetAppServerType

func (span *TSpan) GetAppServerType() int32

func (*TSpan) GetAppid

func (span *TSpan) GetAppid() string

func (*TSpan) GetElapsedTime

func (span *TSpan) GetElapsedTime() int32

func (*TSpan) GetStartTime

func (span *TSpan) GetStartTime() int64

func (*TSpan) IsFailed

func (span *TSpan) IsFailed() bool

type TSpanEvent

type TSpanEvent struct {
	Name           string       `json:"name"`
	ExceptionInfo  string       `json:"EXP,omitempty"`
	DestinationId  string       `json:"dst,omitempty"`
	NextSpanId     int64        `json:"nsid,string,omitempty"`
	EndPoint       string       `json:"server,omitempty"`
	StartElapsed   int32        `json:"S"`
	EndElapsed     int32        `json:"E"`
	StartElapsedV2 int32        `json:":S"`
	EndElapsedV2   int32        `json:":E"`
	ServiceType    int32        `json:"stp,string"`
	Clues          []string     `json:"clues,omitempty"`
	Calls          []TSpanEvent `json:"calls,omitempty"`
	SqlMeta        string       `json:"SQL,omitempty"`
}

func (*TSpanEvent) GetEndElapsed

func (spanEv *TSpanEvent) GetEndElapsed() int32

func (*TSpanEvent) GetStartElapsed

func (spanEv *TSpanEvent) GetStartElapsed() int32

type UrlTemplateReport

type UrlTemplateReport struct {
	BucketVersion int32
	// contains filtered or unexported fields
}

func CreateUrlTemplateReport

func CreateUrlTemplateReport() *UrlTemplateReport

func (*UrlTemplateReport) Interceptor

func (utr *UrlTemplateReport) Interceptor(span *TSpan) bool

func (*UrlTemplateReport) MoveUtReport

func (utr *UrlTemplateReport) MoveUtReport() *v1.PStatMessage

Jump to

Keyboard shortcuts

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