dbwriter

package
v1.6.65 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultPartition  = ckdb.TimeFuncHour
	LabelTraceID      = "trace_id"
	LabelSpanName     = "span_name"
	LabelAppService   = "app_service"
	LabelAppInstance  = "app_instance"
	LabelLanguageType = "profile_language_type"
	LabelProfileID    = "profile_id"
)
View Source
const (
	PROFILE_DB    = "profile"
	PROFILE_TABLE = "in_process"
)

Variables

View Source
var InProcessCounter uint32

Functions

func GenProfileCKTable

func GenProfileCKTable(cluster, dbName, tableName, storagePolicy, ckdbType string, ttl int, coldStorage *ckdb.ColdStorage) *ckdb.Table

func ProfileColumns

func ProfileColumns() []*ckdb.Column

func ReleaseInProcess

func ReleaseInProcess(p *InProcessProfile)

Types

type ClusterNode

type ClusterNode struct {
	Addr string
	Port uint16
}

type Counter

type Counter struct {
	ProfilesCount int64 `statsd:"profiles-count"`
	WriteErr      int64 `statsd:"write-err"`
}

type InProcessProfile

type InProcessProfile struct {
	Time uint32

	// Profile
	AppService         string `json:"app_service"`
	ProfileLocationStr string `json:"profile_location_str"` // package/(class/struct)/function name, e.g.: java/lang/Thread.run
	ProfileValue       int64  `json:"profile_value"`
	// profile_event_type 的取值与 profile_value_unit 对应关系见下
	// profile_event_type: relations between profile_event_type and profile_value_unit is under the struct definition
	ProfileEventType       string   `json:"profile_event_type"` // event_type, e.g.: cpu/itimer...
	ProfileValueUnit       string   `json:"profile_value_unit"`
	ProfileCreateTimestamp int64    `json:"profile_create_timestamp"` // 数据上传时间 while data upload to server
	ProfileInTimestamp     int64    `json:"profile_in_timestamp"`     // 数据写入时间 while data write in storage
	ProfileLanguageType    string   `json:"profile_language_type"`    // e.g.: Golang/Java/Python...
	ProfileID              string   `json:"profile_id"`
	TraceID                string   `json:"trace_id"`
	SpanName               string   `json:"span_name"`
	AppInstance            string   `json:"app_instance"`
	TagNames               []string `json:"tag_names"`
	TagValues              []string `json:"tag_values"`
	CompressionAlgo        string   `json:"compression_algo"`
	// Ebpf Profile Infos
	ProcessID        uint32 `json:"process_id"`
	ProcessStartTime int64  `json:"process_start_time"`
	GPID             uint32

	// Universal Tag
	VtapID       uint16
	RegionID     uint16
	AZID         uint16
	SubnetID     uint16
	L3EpcID      int32
	HostID       uint16
	PodID        uint32
	PodNodeID    uint32
	PodNSID      uint16
	PodClusterID uint16
	PodGroupID   uint32

	AutoInstanceID   uint32
	AutoInstanceType uint8
	AutoServiceID    uint32
	AutoServiceType  uint8

	IP4    uint32 `json:"ip4"`
	IP6    net.IP `json:"ip6"`
	IsIPv4 bool   `json:"is_ipv4"`

	L3DeviceType uint8
	L3DeviceID   uint32
	ServiceID    uint32

	// Not stored, only determines which database to store in.
	// When Orgid is 0 or 1, it is stored in database 'profile', otherwise stored in '<OrgId>_profile'.
	OrgId  uint16
	TeamID uint16
	// contains filtered or unexported fields
}

func AcquireInProcess

func AcquireInProcess() *InProcessProfile

func (*InProcessProfile) Clone

func (p *InProcessProfile) Clone() *InProcessProfile

func (*InProcessProfile) FillProfile

func (p *InProcessProfile) FillProfile(createTime time.Time,
	profileUnit string,
	profileLabels map[string]string,
	platformData *grpc.PlatformInfoTable,
	vtapID, orgId, teamId uint16,
	podID uint32,
	profileName string,
	eventType string,
	location string,
	compressionAlgo string,
	self int64,
	inTimeStamp time.Time,
	languageType string,
	pid uint32,
	stime int64,
	tagNames []string,
	tagValues []string)

func (*InProcessProfile) GenerateFlowTags

func (p *InProcessProfile) GenerateFlowTags(cache *flow_tag.FlowTagCache)

func (*InProcessProfile) OrgID

func (p *InProcessProfile) OrgID() uint16

func (*InProcessProfile) Release

func (p *InProcessProfile) Release()

func (*InProcessProfile) String

func (p *InProcessProfile) String() string

func (*InProcessProfile) WriteBlock

func (p *InProcessProfile) WriteBlock(block *ckdb.Block)

type ProfileWriter

type ProfileWriter struct {
	utils.Closable
	// contains filtered or unexported fields
}

func NewProfileWriter

func NewProfileWriter(msgType datatype.MessageType, decoderIndex int, config *config.Config) (*ProfileWriter, error)

func (*ProfileWriter) GetCounter

func (p *ProfileWriter) GetCounter() interface{}

func (*ProfileWriter) Write

func (p *ProfileWriter) Write(m []interface{})

Jump to

Keyboard shortcuts

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