flow_metrics

package
v0.0.0-...-8d187f3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppTRIFFIC_RRT_MAX = iota
	AppTRIFFIC_RRT_SUM
	AppTRIFFIC_RRT_COUNT
)
View Source
const (
	APPLATENCY_RRT_MAX = iota
	APPLATENCY_RRT_SUM
	APPLATENCY_RRT_COUNT
)
View Source
const (
	APPANOMALY_CLIENT_ERROR = iota
	APPANOMALY_SERVER_ERROR
	APPANOMALY_TIMEOUT
	APPANOMALY_ERROR
)
View Source
const (
	TRAFFIC_PACKET_TX = iota
	TRAFFIC_PACKET_RX
	TRAFFIC_PACKET

	TRAFFIC_BYTE_TX
	TRAFFIC_BYTE_RX
	TRAFFIC_BYTE

	TRAFFIC_L3_BYTE_TX
	TRAFFIC_L3_BYTE_RX
	TRAFFIC_L4_BYTE_TX
	TRAFFIC_L4_BYTE_RX

	TRAFFIC_NEW_FLOW
	TRAFFIC_CLOSED_FLOW

	TRAFFIC_L7_REQUEST
	TRAFFIC_L7_RESPONSE

	TRAFFIC_SYN_COUNT
	TRAFFIC_SYNACK_COUNT
)
View Source
const (
	LATENCY_RTT = iota
	LATENCY_RTT_CLIENT
	LATENCY_RTT_SERVER
	LATENCY_SRT
	LATENCY_ART
	LATENCY_RRT
	LATENCY_CIT
)
View Source
const (
	PERF_RETRANS_TX = iota
	PERF_RETRANS_RX
	PERF_RETRANS

	PERF_ZERO_WIN_TX
	PERF_ZERO_WIN_RX
	PERF_ZERO_WIN

	PERF_RETRANS_SYN
	PERF_RETRANS_SYNACK
)
View Source
const (
	ANOMALY_CLIENT_RST_FLOW = iota
	ANOMALY_SERVER_RST_FLOW

	ANOMALY_SERVER_SYN_MISS
	ANOMALY_CLIENT_ACK_MISS

	ANOMALY_CLIENT_HALF_CLOSE_FLOW
	ANOMALY_SERVER_HALF_CLOSE_FLOW

	ANOMALY_CLIENT_SOURCE_PORT_REUSE
	ANOMALY_SERVER_RESET
	ANOMALY_SERVER_QUEUE_LACK

	ANOMALY_CLIENT_ESTABLISH_OTHER_RST
	ANOMALY_SERVER_ESTABLISH_OTHER_RST

	ANOMALY_TCP_TIMEOUT

	ANOMALY_CLIENT_ESTABLISH_FAIL
	ANOMALY_SERVER_ESTABLISH_FAIL
	ANOMALY_TCP_ESTABLISH_FAIL

	ANOMALY_TRANSFER_FAIL
	ANOMALY_RST_FAIL
)
View Source
const (
	ANOMALY_L7_CLIENT_ERROR = iota
	ANOMALY_L7_SERVER_ERROR
	ANOMALY_L7_TIMEOUT
	ANOMALY_L7_ERROR
)
View Source
const (
	FLOW_SECOND_ID uint8 = iota
	FLOW_ID

	ACL_ID // 目前meter的ACL_ID和PACKET_ID内容一致
	APP_ID

	MAX_APP_ID
)
View Source
const (
	MAIN uint8 = iota

	MAX_MEASUREMENT_ID
)
View Source
const (
	ClientToServer = 1 << iota
	ServerToClient
	LocalToLocal

	// 以下类型为转换tapside而增加,在写入db时均记为c2s或s2c
	ClientNodeToServer              = ClientToServer | DirectionEnum(NodeSide)              // 客户端容器节点,路由、SNAT、隧道
	ServerNodeToClient              = ServerToClient | DirectionEnum(NodeSide)              // 服务端容器节点,路由、SNAT、隧道
	ClientHypervisorToServer        = ClientToServer | DirectionEnum(HypervisorSide)        // 客户端宿主机,隧道
	ServerHypervisorToClient        = ServerToClient | DirectionEnum(HypervisorSide)        // 服务端宿主机,隧道
	ClientGatewayHypervisorToServer = ClientToServer | DirectionEnum(GatewayHypervisorSide) // 客户端网关宿主机
	ServerGatewayHypervisorToClient = ServerToClient | DirectionEnum(GatewayHypervisorSide) // 服务端网关宿主机
	ClientGatewayToServer           = ClientToServer | DirectionEnum(GatewaySide)           // 客户端网关(特指VIP机制的SLB,例如微软云MUX等), Mac地址对应的接口为vip设备
	ServerGatewayToClient           = ServerToClient | DirectionEnum(GatewaySide)           // 服务端网关(特指VIP机制的SLB,例如微软云MUX等), Mac地址对应的接口为vip设备
	ClientProcessToServer           = ClientToServer | DirectionEnum(ProcessSide)           // 客户端进程
	ServerProcessToClient           = ServerToClient | DirectionEnum(ProcessSide)           // 服务端进程
	ClientAppToServer               = ClientToServer | DirectionEnum(AppSide)               // 客户端应用
	ServerAppToClient               = ServerToClient | DirectionEnum(AppSide)               // 服务端应用
)
View Source
const (
	Client TAPSideEnum = 1 << iota
	Server
	Local
	ClientNode              = Client | TAPSideEnum(NodeSide)
	ServerNode              = Server | TAPSideEnum(NodeSide)
	ClientHypervisor        = Client | TAPSideEnum(HypervisorSide)
	ServerHypervisor        = Server | TAPSideEnum(HypervisorSide)
	ClientGatewayHypervisor = Client | TAPSideEnum(GatewayHypervisorSide)
	ServerGatewayHypervisor = Server | TAPSideEnum(GatewayHypervisorSide)
	ClientGateway           = Client | TAPSideEnum(GatewaySide)
	ServerGateway           = Server | TAPSideEnum(GatewaySide)
	ClientProcess           = Client | TAPSideEnum(ProcessSide)
	ServerProcess           = Server | TAPSideEnum(ProcessSide)
	ClientApp               = Client | TAPSideEnum(AppSide)
	ServerApp               = Server | TAPSideEnum(AppSide)
	App                     = TAPSideEnum(AppSide)
	Rest                    = 0
)
View Source
const (
	ROLE_CLIENT = 0
	ROLE_SERVER = 1
)
View Source
const (
	ID_OTHER    = -1
	ID_INTERNET = -2
)
View Source
const (
	SUFFIX_ACL = 1 + iota
	SUFFIX_EDGE
	SUFFIX_ACL_EDGE
	SUFFIX_PORT
	SUFFIX_ACL_PORT
	SUFFIX_EDGE_PORT
	SUFFIX_ACL_EDGE_PORT
)
View Source
const (
	USAGE_PACKET_TX = iota
	USAGE_PACKET_RX
	USAGE_PACKET

	USAGE_BYTE_TX
	USAGE_BYTE_RX
	USAGE_BYTE

	USAGE_L3_BYTE_TX
	USAGE_L3_BYTE_RX
	USAGE_L4_BYTE_TX
	USAGE_L4_BYTE_RX
)
View Source
const (
	FLOW_LOAD = iota
)
View Source
const (
	MAX_STRING_LENGTH = 2048
)
View Source
const (
	MINI_FIELD_FULL_CODES = IP | IPPath | L3EpcID | L3EpcIDPath | VTAPID | Protocol | ServerPort |
		MAC | MACPath | Direction | TAPType | ACLGID | L7Protocol | TunnelIPID
)
View Source
const TAP_PORT_STR_LEN = 8

Variables

View Source
var DatabaseSuffix = [...]string{
	0:                    "",
	SUFFIX_ACL:           "_acl",
	SUFFIX_EDGE:          "_edge",
	SUFFIX_ACL_EDGE:      "_acl_edge",
	SUFFIX_PORT:          "_port",
	SUFFIX_ACL_PORT:      "_acl_port",
	SUFFIX_EDGE_PORT:     "_edge_port",
	SUFFIX_ACL_EDGE_PORT: "_acl_edge_port",
}
View Source
var MeasurementNames [MAX_MEASUREMENT_ID]string = [MAX_MEASUREMENT_ID]string{
	"main",
}
View Source
var MeasurementNamesToID map[string]uint8
View Source
var MeterNamesToID map[string]uint8
View Source
var MeterVTAPNames [MAX_APP_ID]string = [MAX_APP_ID]string{
	"vtap_flow",
	"vtap_flow",
	"vtap_wan",
	"vtap_packet",
	"vtap_acl",
	"vtap_app",
}
View Source
var TAPSideEnumsString = []string{
	Rest:                    "rest",
	Client:                  "c",
	Server:                  "s",
	Local:                   "local",
	ClientNode:              "c-nd",
	ServerNode:              "s-nd",
	ClientHypervisor:        "c-hv",
	ServerHypervisor:        "s-hv",
	ClientGatewayHypervisor: "c-gw-hv",
	ServerGatewayHypervisor: "s-gw-hv",
	ClientGateway:           "c-gw",
	ServerGateway:           "s-gw",
	ClientProcess:           "c-p",
	ServerProcess:           "s-p",
	ClientApp:               "c-app",
	ServerApp:               "s-app",
	App:                     "app",
}

Functions

func AnomalyColumns

func AnomalyColumns() []*ckdb.Column

Columns列和WriteBlock的列需要按顺序一一对应

func AppAnomalyColumns

func AppAnomalyColumns() []*ckdb.Column

Columns列和WriteBlock的列需要按顺序一一对应

func AppLatencyColumns

func AppLatencyColumns() []*ckdb.Column

Columns列和WriteBlock的列需要按顺序一一对应

func AppMeterColumns

func AppMeterColumns() []*ckdb.Column

func AppTrafficColumns

func AppTrafficColumns() []*ckdb.Column

Columns列和WriteBlock的列需要按顺序一一对应

func EncodeAppMeterToMetrics

func EncodeAppMeterToMetrics(meter *AppMeter) map[string]float64

func EncodeCustomTagToPromLabels

func EncodeCustomTagToPromLabels(tag *CustomTag) []prompb.Label

EncodeCustomTagToPromLabels 将 CustomTag 编码成 prom Label

func EncodeMiniTagToPromLabels

func EncodeMiniTagToPromLabels(tag *MiniTag) []prompb.Label

EncodeMiniTagToPromLabels 将 MiniTag 转换成 prom Label

func EncodeTSDBRow

func EncodeTSDBRow(encoder *codec.SimpleEncoder, timestamp uint64, columnValues []interface{}, isTag []bool, isNil []bool)

func EncodeTagToPromLabels

func EncodeTagToPromLabels(tag *Tag) []prompb.Label

EncodeTagToPromLabels 将 Tag 编码成 prom Label

func FlowLoadColumns

func FlowLoadColumns() []*ckdb.Column

func FlowMeterColumns

func FlowMeterColumns() []*ckdb.Column

func GenTagColumns

func GenTagColumns(code Code) []*ckdb.Column

顺序需要和WriteBlock中一致, 目前time排第一位,其他按字段名字典排序

func GenUniversalTagColumns

func GenUniversalTagColumns(columns []*ckdb.Column) []*ckdb.Column

Note: The order of append() must be consistent with the order of Write() in WriteBlock. Currently all fields are sorted lexicographically by name.

func GetMeasurementID

func GetMeasurementID(name string) uint8

func GetMeterID

func GetMeterID(name string) uint8

func GetMetricsTables

func GetMetricsTables(engine ckdb.EngineType, version, cluster, storagePolicy, ckdbType string, flowMinuteTtl, flowSecondTtl, appMinuteTtl, appSecondTtl int, coldStorages map[string]*ckdb.ColdStorage) []*ckdb.Table

func LatencyColumns

func LatencyColumns() []*ckdb.Column

Columns列和WriteBlock的列需要按顺序一一对应

func MarshalInt32WithSpecialID

func MarshalInt32WithSpecialID(v int32) int32

func PerformanceColumns

func PerformanceColumns() []*ckdb.Column

Columns列和WriteBlock的列需要按顺序一一对应

func ReleaseField

func ReleaseField(field *Field)

func ReleaseMiniField

func ReleaseMiniField(miniField *MiniField)

func ReleaseMiniTag

func ReleaseMiniTag(miniTag *MiniTag)

ReleaseMiniTag 需要释放Tag拥有的Field

func ReleaseTag

func ReleaseTag(tag *Tag)

ReleaseTag 需要释放Tag拥有的Field

func TrafficColumns

func TrafficColumns() []*ckdb.Column

Columns列和WriteBlock的列需要按顺序一一对应

func UsageMeterColumns

func UsageMeterColumns() []*ckdb.Column

Columns列和WriteBlock的列需要一一对应

Types

type Anomaly

type Anomaly struct {
	ClientRstFlow       uint64 `json:"client_rst_flow" category:"$metrics" sub:"tcp_error"`
	ServerRstFlow       uint64 `json:"server_rst_flow" category:"$metrics" sub:"tcp_error"`
	ServerSynMiss       uint64 `json:"server_syn_miss" category:"$metrics" sub:"tcp_error"`
	ClientAckMiss       uint64 `json:"client_ack_miss" category:"$metrics" sub:"tcp_error"`
	ClientHalfCloseFlow uint64 `json:"client_half_close_flow" category:"$metrics" sub:"tcp_error"`
	ServerHalfCloseFlow uint64 `json:"server_half_close_flow" category:"$metrics" sub:"tcp_error"`

	ClientSourcePortReuse uint64 `json:"client_source_port_reuse" category:"$metrics" sub:"tcp_error"`
	ClientEstablishReset  uint64 `json:"client_establish_other_rst" category:"$metrics" sub:"tcp_error"`
	ServerReset           uint64 `json:"server_reset" category:"$metrics" sub:"tcp_error"`
	ServerQueueLack       uint64 `json:"server_queue_lack" category:"$metrics" sub:"tcp_error"`
	ServerEstablishReset  uint64 `json:"server_establish_other_rst" category:"$metrics" sub:"tcp_error"`
	TCPTimeout            uint64 `json:"tcp_timeout" category:"$metrics" sub:"tcp_error"`

	ClientEstablishFail uint64 `json:"client_establish_fail" category:"$metrics" sub:"tcp_error"`
	ServerEstablishFail uint64 `json:"server_establish_fail" category:"$metrics" sub:"tcp_error"`
	TCPEstablishFail    uint64 `json:"tcp_establish_fail" category:"$metrics" sub:"tcp_error"`
	TCPTransferFail     uint64 `json:"tcp_transfer_fail" category:"$metrics" sub:"tcp_error"`
	TCPRstFail          uint64 `json:"tcp_rst_fail" category:"$metrics" sub:"tcp_error"`

	L7ClientError uint32 `json:"l7_client_error" category:"$metrics" sub:"application"`
	L7ServerError uint32 `json:"l7_server_error" category:"$metrics" sub:"application"`
	L7Timeout     uint32 `json:"l7_timeout" category:"$metrics" sub:"application"`
}

func (*Anomaly) ConcurrentMerge

func (a *Anomaly) ConcurrentMerge(other *Anomaly)

func (*Anomaly) MarshalTo

func (a *Anomaly) MarshalTo(b []byte) int

func (*Anomaly) ReadFromPB

func (a *Anomaly) ReadFromPB(p *pb.Anomaly)

func (*Anomaly) Reverse

func (_ *Anomaly) Reverse()

func (*Anomaly) SequentialMerge

func (a *Anomaly) SequentialMerge(other *Anomaly)

func (*Anomaly) WriteBlock

func (a *Anomaly) WriteBlock(block *ckdb.Block)

WriteBlock的列和AnomalyColumns需要按顺序一一对应

func (*Anomaly) WriteToPB

func (a *Anomaly) WriteToPB(p *pb.Anomaly)

type AppAnomaly

type AppAnomaly struct {
	ClientError uint32 `json:"client_error" category:"$metrics" sub:"error"`
	ServerError uint32 `json:"server_error" category:"$metrics" sub:"error"`
	Timeout     uint32 `json:"timeout" category:"$metrics" sub:"error"`
}

func (*AppAnomaly) ConcurrentMerge

func (a *AppAnomaly) ConcurrentMerge(other *AppAnomaly)

func (*AppAnomaly) MarshalTo

func (a *AppAnomaly) MarshalTo(b []byte) int

func (*AppAnomaly) ReadFromPB

func (a *AppAnomaly) ReadFromPB(p *pb.AppAnomaly)

func (*AppAnomaly) Reverse

func (_ *AppAnomaly) Reverse()

func (*AppAnomaly) SequentialMerge

func (a *AppAnomaly) SequentialMerge(other *AppAnomaly)

func (*AppAnomaly) WriteBlock

func (a *AppAnomaly) WriteBlock(block *ckdb.Block)

WriteBlock的列和AnomalyColumns需要按顺序一一对应

func (*AppAnomaly) WriteToPB

func (a *AppAnomaly) WriteToPB(p *pb.AppAnomaly)

type AppLatency

type AppLatency struct {
	RRTMax   uint32 `json:"rrt_max" category:"$metrics" sub:"delay"` // us
	RRTSum   uint64 `json:"rrt_sum" category:"$metrics" sub:"delay"` // us
	RRTCount uint32 `json:"rrt_count" category:"$metrics" sub:"delay"`
}

func (*AppLatency) ConcurrentMerge

func (l *AppLatency) ConcurrentMerge(other *AppLatency)

func (*AppLatency) MarshalTo

func (l *AppLatency) MarshalTo(b []byte) int

func (*AppLatency) ReadFromPB

func (l *AppLatency) ReadFromPB(p *pb.AppLatency)

func (*AppLatency) Reverse

func (_ *AppLatency) Reverse()

func (*AppLatency) SequentialMerge

func (l *AppLatency) SequentialMerge(other *AppLatency)

func (*AppLatency) WriteBlock

func (l *AppLatency) WriteBlock(block *ckdb.Block)

WriteBlock和LatencyColumns的列需要按顺序一一对应

func (*AppLatency) WriteToPB

func (l *AppLatency) WriteToPB(p *pb.AppLatency)

type AppMeter

type AppMeter struct {
	AppTraffic
	AppLatency
	AppAnomaly
}

func (*AppMeter) ConcurrentMerge

func (m *AppMeter) ConcurrentMerge(other Meter)

func (*AppMeter) ID

func (m *AppMeter) ID() uint8

func (*AppMeter) MarshalTo

func (m *AppMeter) MarshalTo(b []byte) int

func (*AppMeter) Name

func (m *AppMeter) Name() string

func (*AppMeter) ReadFromPB

func (m *AppMeter) ReadFromPB(p *pb.AppMeter)

func (*AppMeter) Reverse

func (m *AppMeter) Reverse()

func (*AppMeter) SequentialMerge

func (m *AppMeter) SequentialMerge(other Meter)

func (*AppMeter) SortKey

func (m *AppMeter) SortKey() uint64

func (*AppMeter) ToKVString

func (m *AppMeter) ToKVString() string

func (*AppMeter) VTAPName

func (m *AppMeter) VTAPName() string

func (*AppMeter) WriteBlock

func (m *AppMeter) WriteBlock(block *ckdb.Block)

func (*AppMeter) WriteToPB

func (m *AppMeter) WriteToPB(p *pb.AppMeter)

type AppTraffic

type AppTraffic struct {
	Request        uint32 `json:"request" category:"$metrics" sub:"throughput"`
	Response       uint32 `json:"response" category:"$metrics" sub:"throughput"`
	DirectionScore uint8  `json:"direction_score" category:"$metrics" sub:"throughput"`
}

func (*AppTraffic) ConcurrentMerge

func (t *AppTraffic) ConcurrentMerge(other *AppTraffic)

func (*AppTraffic) MarshalTo

func (t *AppTraffic) MarshalTo(b []byte) int

func (*AppTraffic) ReadFromPB

func (t *AppTraffic) ReadFromPB(p *pb.AppTraffic)

func (*AppTraffic) Reverse

func (_ *AppTraffic) Reverse()

func (*AppTraffic) SequentialMerge

func (t *AppTraffic) SequentialMerge(other *AppTraffic)

func (*AppTraffic) WriteBlock

func (t *AppTraffic) WriteBlock(block *ckdb.Block)

WriteBlock和LatencyColumns的列需要按顺序一一对应

func (*AppTraffic) WriteToPB

func (t *AppTraffic) WriteToPB(p *pb.AppTraffic)

type Code

type Code uint64
const (
	IP Code = 0x1 << iota
	L3EpcID
	L3Device
	SubnetID
	RegionID
	PodNodeID
	HostID
	AZID
	PodGroupID
	PodNSID
	PodID
	MAC
	PodClusterID
	ServiceID
	Resource // 1<< 14
	GPID     // 1<< 15

)
const (
	IPPath Code = 0x100000 << iota // 1 << 20
	L3EpcIDPath
	L3DevicePath
	SubnetIDPath
	RegionIDPath
	PodNodeIDPath
	HostIDPath
	AZIDPath
	PodGroupIDPath
	PodNSIDPath
	PodIDPath
	MACPath
	PodClusterIDPath
	ServiceIDPath
	ResourcePath // 1<< 34
	GPIDPath     // 1<< 35

)
const (
	Direction Code = 0x10000000000 << iota // 1 << 40
	ACLGID
	Protocol
	ServerPort

	TAPType

	VTAPID
	TAPSide
	TAPPort
	IsKeyService
	L7Protocol // also represents AppService,AppInstance,EndPoint,BizType
	SignalSource
)
const (
	TunnelIPID Code = 1 << 62
)

func (Code) HasEdgeTagField

func (c Code) HasEdgeTagField() bool

type CustomMeter

type CustomMeter struct {
	Meta *CustomMeterMeta

	Values []uint64
}

func (*CustomMeter) Decode

func (m *CustomMeter) Decode(decoder *codec.SimpleDecoder)

func (*CustomMeter) Encode

func (m *CustomMeter) Encode(encoder *codec.SimpleEncoder)

type CustomMeterMeta

type CustomMeterMeta struct {
	Names []string
	Types []CustomMeterType
	// contains filtered or unexported fields
}

func (*CustomMeterMeta) IndexOf

func (m *CustomMeterMeta) IndexOf(name string) int

func (*CustomMeterMeta) PopulateCache

func (m *CustomMeterMeta) PopulateCache()

func (*CustomMeterMeta) Validate

func (m *CustomMeterMeta) Validate(cm *CustomMeter) bool

type CustomMeterType

type CustomMeterType uint8
const (
	CUSTOM_METER_U64 CustomMeterType = iota
	CUSTOM_METER_U32
)

type CustomTag

type CustomTag struct {
	Meta *CustomTagMeta

	Values []string
	// 每一位表示对应index下的Values[i]有意义
	// 如 Code=3时Values[0]和Values[1]有意义
	Code uint64

	pool.ReferenceCount
	// contains filtered or unexported fields
}

func AcquireCustomTag

func AcquireCustomTag() *CustomTag

func (*CustomTag) Clone

func (t *CustomTag) Clone() Tagger

func (*CustomTag) Decode

func (t *CustomTag) Decode(decoder *codec.SimpleDecoder)

func (*CustomTag) Encode

func (t *CustomTag) Encode(encoder *codec.SimpleEncoder)

func (*CustomTag) EncodeWithCode

func (t *CustomTag) EncodeWithCode(code uint64, encoder *codec.SimpleEncoder)

func (*CustomTag) GetCode

func (t *CustomTag) GetCode() uint64

func (*CustomTag) GetID

func (t *CustomTag) GetID(encoder *codec.SimpleEncoder) string

func (*CustomTag) GetTAPType

func (t *CustomTag) GetTAPType() uint8

func (*CustomTag) MarshalTo

func (t *CustomTag) MarshalTo(b []byte) int

func (*CustomTag) PseudoClone

func (t *CustomTag) PseudoClone() Tagger

func (*CustomTag) Release

func (t *CustomTag) Release()

func (*CustomTag) SetCode

func (t *CustomTag) SetCode(code uint64)

func (*CustomTag) SetID

func (t *CustomTag) SetID(id string)

func (*CustomTag) String

func (t *CustomTag) String() string

func (*CustomTag) ToKVString

func (t *CustomTag) ToKVString() string

type CustomTagMeta

type CustomTagMeta struct {
	Names []string
	// contains filtered or unexported fields
}

func (*CustomTagMeta) IndexOf

func (m *CustomTagMeta) IndexOf(name string) int

func (*CustomTagMeta) PopulateCache

func (m *CustomTagMeta) PopulateCache()

func (*CustomTagMeta) Validate

func (m *CustomTagMeta) Validate(ct *CustomTag) bool

type CustomTagMeterMeta

type CustomTagMeterMeta struct {
	Tag   CustomTagMeta
	Meter CustomMeterMeta
}

func (*CustomTagMeterMeta) Decode

func (t *CustomTagMeterMeta) Decode(decoder *codec.SimpleDecoder)

func (*CustomTagMeterMeta) Encode

func (t *CustomTagMeterMeta) Encode(encoder *codec.SimpleEncoder)

type DeviceType

type DeviceType uint8
const (
	VMDevice DeviceType

	ThirdPartyDevice // 3

	VGatewayDevice // 5
	HostDevice
	NetworkDevice
	FloatingIPDevice
	DHCPDevice
)

type DirectionEnum

type DirectionEnum uint8

func (DirectionEnum) IsClientToServer

func (d DirectionEnum) IsClientToServer() bool

func (DirectionEnum) IsGateway

func (d DirectionEnum) IsGateway() bool

func (DirectionEnum) IsServerToClient

func (d DirectionEnum) IsServerToClient() bool

func (DirectionEnum) ToTAPSide

func (d DirectionEnum) ToTAPSide() TAPSideEnum

type Field

type Field struct {

	// 用于区分不同的trident及其不同的pipeline,用于如下场景:
	//   - agent和ingester之间的数据传输
	//   - ingester写入clickhouse,作用类似_id,序列化为_tid
	GlobalThreadID uint8 `json:"thread_id" category:"$tag"`

	// structTag  "datasource":"n|nm|a|am" means datasource: network, network_map, application, application_map
	IP6              net.IP `json:"ip6" map_json:"ip6_0" category:"$tag" sub:"network_layer" to_string:"IPv6String" ` // FIXME: 合并IP6和IP
	MAC              uint64
	IP               uint32     `json:"ip4" map_json:"ip4_0" category:"$tag" sub:"network_layer" to_string:"IPv4String"`
	L3EpcID          int32      `json:"l3_epc_id" map_json:"l3_epc_id_0" category:"$tag" sub:"universal_tag"`
	L3DeviceID       uint32     `json:"l3_device_id" map_json:"l3_device_id_0" category:"$tag" sub:"universal_tag"`
	L3DeviceType     DeviceType `json:"l3_device_type" map_json:"l3_device_type_0" category:"$tag" sub:"universal_tag"`
	RegionID         uint16     `json:"region_id" map_json:"region_id_0" category:"$tag" sub:"universal_tag"`
	SubnetID         uint16     `json:"subnet_id" map_json:"subnet_id_0" category:"$tag" sub:"universal_tag"`
	HostID           uint16     `json:"host_id" map_json:"host_id_0" category:"$tag" sub:"universal_tag"`
	PodNodeID        uint32     `json:"pod_node_id" map_json:"pod_node_id_0" category:"$tag" sub:"universal_tag"`
	AZID             uint16     `json:"az_id" map_json:"az_id_0" category:"$tag" sub:"universal_tag"`
	PodGroupID       uint32     `json:"pod_group_id" map_json:"pod_group_id_0" category:"$tag" sub:"universal_tag"`
	PodNSID          uint16     `json:"pod_ns_id" map_json:"pod_ns_id_0" category:"$tag" sub:"universal_tag"`
	PodID            uint32     `json:"pod_id" map_json:"pod_id_0" category:"$tag" sub:"universal_tag"`
	PodClusterID     uint16     `json:"pod_cluster_id" map_json:"pod_cluster_id_0" category:"$tag" sub:"universal_tag"`
	ServiceID        uint32     `json:"service_id" map_json:"service_id_0" category:"$tag" sub:"universal_tag"`
	AutoInstanceID   uint32     `json:"auto_instance_id" map_json:"auto_instance_id_0" category:"$tag" sub:"universal_tag"`
	AutoInstanceType uint8      `json:"auto_instance_type" map_json:"auto_instance_type_0" category:"$tag" sub:"universal_tag"`
	AutoServiceID    uint32     `json:"auto_service_id" map_json:"auto_service_id_0" category:"$tag" sub:"universal_tag"`
	AutoServiceType  uint8      `json:"auto_service_type" map_json:"auto_service_type_0" category:"$tag" sub:"universal_tag"`
	GPID             uint32     `json:"gprocess_id" map_json:"gprocess_id_0" category:"$tag" sub:"universal_tag"`

	MAC1              uint64
	IP61              net.IP     `json:"ip6_1" category:"$tag" sub:"network_layer" to_string:"IPv6String" datasource:"nm|am"` // FIXME: 合并IP61和IP1
	IP1               uint32     `json:"ip4_1" category:"$tag" sub:"network_layer" to_string:"IPv4String" datasource:"nm|am"`
	L3EpcID1          int32      `json:"l3_epc_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	L3DeviceID1       uint32     `json:"l3_device_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	L3DeviceType1     DeviceType `json:"l3_device_type_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	RegionID1         uint16     `json:"region_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	SubnetID1         uint16     `json:"subnet_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	HostID1           uint16     `json:"host_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	PodNodeID1        uint32     `json:"pod_node_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	AZID1             uint16     `json:"az_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	PodGroupID1       uint32     `json:"pod_group_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	PodNSID1          uint16     `json:"pod_ns_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	PodID1            uint32     `json:"pod_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	PodClusterID1     uint16     `json:"pod_cluster_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	ServiceID1        uint32     `json:"service_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	AutoInstanceID1   uint32     `json:"auto_instance_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	AutoInstanceType1 uint8      `json:"auto_instance_type_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	AutoServiceID1    uint32     `json:"auto_service_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	AutoServiceType1  uint8      `json:"auto_service_type_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`
	GPID1             uint32     `json:"gprocess_id_1" category:"$tag" sub:"universal_tag" datasource:"nm|am"`

	ACLGID     uint16
	Role       uint8             `json:"role" category:"$tag" sub:"capture_info" enumfile:"role" datasource:"n|a"`
	Protocol   layers.IPProtocol `json:"protocol" category:"$tag" sub:"network_layer" enumfile:"protocol"`
	ServerPort uint16            `json:"server_port" category:"$tag" sub:"transport_layer"`
	VTAPID     uint16            `json:"agent_id" category:"$tag" sub:"capture_info"`
	// Not stored, only determines which database to store in.
	// When Orgid is 0 or 1, it is stored in database 'flow_metrics', otherwise stored in '<OrgId>_flow_metrics'.
	OrgId   uint16 `json:"org_id" category:"$tag"`
	TeamID  uint16 `json:"team_id" category:"$tag"`
	TAPPort datatype.TapPort
	// caculate from TAPPort
	TapPort     uint32              `json:"capture_nic" category:"$tag" sub:"capture_info" datasource:"nm|am"`
	TapPortType uint8               `json:"capture_nic_type" category:"$tag" sub:"capture_info" enumfile:"capture_nic_type" datasource:"nm|am"`
	NatSource   datatype.NATSource  `json:"nat_source" category:"$tag" sub:"capture_info" enumfile:"nat_source" datasource:"nm|am"`
	TunnelType  datatype.TunnelType `json:"tunnel_type" category:"$tag" sub:"tunnel_info" enumfile:"tunnel_type" datasource:"nm|am"`

	TAPSide TAPSideEnum
	// only for exporters
	TAPSideStr   string      `json:"observation_point" category:"$tag" sub:"capture_info" enumfile:"observation_point" datasource:"nm|am"`
	TAPType      TAPTypeEnum `json:"capture_network_type_id" category:"$tag" sub:"capture_info"`
	IsIPv4       uint8       `json:"is_ipv4" category:"$tag" sub:"network_layer"` // (8B) 与IP/IP6是共生字段
	IsKeyService uint8
	L7Protocol   datatype.L7Protocol `json:"l7_protocol" category:"$tag" sub:"application_layer" enumfile:"l7_protocol" datasource:"a|am"`
	AppService   string              `json:"app_service" category:"$tag" sub:"service_info" datasource:"a|am"`
	AppInstance  string              `json:"app_instance" category:"$tag" sub:"service_info" datasource:"a|am"`
	Endpoint     string              `json:"endpoint" category:"$tag" sub:"service_info" datasource:"a|am"`
	BizType      uint8               `json:"biz_type" category:"$tag" sub:"capture_info" datasource:"a|am"`
	SignalSource uint16              `json:"signal_source" category:"$tag" sub:"capture_info" enumfile:"l7_signal_source"` // FIXME: network,network_1m should use l4_signal_source for translate

	TagSource, TagSource1 uint8

	TunnelIPID uint16
}

func AcquireField

func AcquireField() *Field

func CloneField

func CloneField(field *Field) *Field

func (*Field) NewTag

func (f *Field) NewTag(c Code) *Tag

type FlowLoad

type FlowLoad struct {
	Load uint64 `json:"flow_load" category:"$metrics" sub:"l4_throughput"`
}

func (*FlowLoad) ConcurrentMerge

func (l *FlowLoad) ConcurrentMerge(other *FlowLoad)

func (*FlowLoad) MarshalTo

func (l *FlowLoad) MarshalTo(b []byte) int

func (*FlowLoad) ReadFromPB

func (l *FlowLoad) ReadFromPB(p *pb.FlowLoad)

func (*FlowLoad) Reverse

func (l *FlowLoad) Reverse()

func (*FlowLoad) SequentialMerge

func (l *FlowLoad) SequentialMerge(other *FlowLoad)

func (*FlowLoad) WriteBlock

func (l *FlowLoad) WriteBlock(block *ckdb.Block)

func (*FlowLoad) WriteToPB

func (l *FlowLoad) WriteToPB(p *pb.FlowLoad)

type FlowMeter

type FlowMeter struct {
	Traffic
	Latency
	Performance
	Anomaly
	FlowLoad
}

func (*FlowMeter) ConcurrentMerge

func (m *FlowMeter) ConcurrentMerge(other Meter)

func (*FlowMeter) ID

func (m *FlowMeter) ID() uint8

func (*FlowMeter) MarshalTo

func (m *FlowMeter) MarshalTo(b []byte) int

func (*FlowMeter) Name

func (m *FlowMeter) Name() string

func (*FlowMeter) ReadFromPB

func (m *FlowMeter) ReadFromPB(p *pb.FlowMeter)

func (*FlowMeter) Reverse

func (m *FlowMeter) Reverse()

func (*FlowMeter) SequentialMerge

func (m *FlowMeter) SequentialMerge(other Meter)

func (*FlowMeter) SortKey

func (m *FlowMeter) SortKey() uint64

func (*FlowMeter) ToKVString

func (m *FlowMeter) ToKVString() string

func (*FlowMeter) VTAPName

func (m *FlowMeter) VTAPName() string

func (*FlowMeter) WriteBlock

func (m *FlowMeter) WriteBlock(block *ckdb.Block)

func (*FlowMeter) WriteToPB

func (m *FlowMeter) WriteToPB(p *pb.FlowMeter)

type Latency

type Latency struct {
	RTTMax       uint32 `json:"rtt_max" category:"$metrics" sub:"delay"`        // us,Trident保证时延最大值不会超过3600s,能容纳在u32内
	RTTClientMax uint32 `json:"rtt_client_max" category:"$metrics" sub:"delay"` // us
	RTTServerMax uint32 `json:"rtt_server_max" category:"$metrics" sub:"delay"` // us
	SRTMax       uint32 `json:"srt_max" category:"$metrics" sub:"delay"`        // us
	ARTMax       uint32 `json:"art_max" category:"$metrics" sub:"delay"`        // us
	RRTMax       uint32 `json:"rrt_max" category:"$metrics" sub:"delay"`        // us
	CITMax       uint32 `json:"cit_max" category:"$metrics" sub:"delay"`        // client idle time max

	RTTSum       uint64 `json:"rtt_sum" category:"$metrics" sub:"delay"`        // us
	RTTClientSum uint64 `json:"rtt_client_sum" category:"$metrics" sub:"delay"` // us
	RTTServerSum uint64 `json:"rtt_server_sum" category:"$metrics" sub:"delay"` // us
	SRTSum       uint64 `json:"srt_sum" category:"$metrics" sub:"delay"`        // us
	ARTSum       uint64 `json:"art_sum" category:"$metrics" sub:"delay"`        // us
	RRTSum       uint64 `json:"rrt_sum" category:"$metrics" sub:"delay"`        // us
	CITSum       uint64 `json:"cit_sum" category:"$metrics" sub:"delay"`

	RTTCount       uint32 `json:"rtt_count" category:"$metrics" sub:"delay"`
	RTTClientCount uint32 `json:"rtt_client_count" category:"$metrics" sub:"delay"`
	RTTServerCount uint32 `json:"rtt_server_count" category:"$metrics" sub:"delay"`
	SRTCount       uint32 `json:"srt_count" category:"$metrics" sub:"delay"`
	ARTCount       uint32 `json:"art_count" category:"$metrics" sub:"delay"`
	RRTCount       uint32 `json:"rrt_count" category:"$metrics" sub:"delay"`
	CITCount       uint32 `json:"cit_count" category:"$metrics" sub:"delay"`
}

func (*Latency) ConcurrentMerge

func (l *Latency) ConcurrentMerge(other *Latency)

func (*Latency) MarshalTo

func (l *Latency) MarshalTo(b []byte) int

func (*Latency) ReadFromPB

func (l *Latency) ReadFromPB(p *pb.Latency)

func (*Latency) Reverse

func (_ *Latency) Reverse()

func (*Latency) SequentialMerge

func (l *Latency) SequentialMerge(other *Latency)

func (*Latency) WriteBlock

func (l *Latency) WriteBlock(block *ckdb.Block)

WriteBlock和LatencyColumns的列需要按顺序一一对应

func (*Latency) WriteToPB

func (l *Latency) WriteToPB(p *pb.Latency)

type Meter

type Meter interface {
	ID() uint8
	Name() string
	VTAPName() string
	ConcurrentMerge(Meter)
	SequentialMerge(Meter)
	ToKVString() string
	MarshalTo([]byte) int
	SortKey() uint64
	Release()
	Reverse()
	ToReversed() Meter
	WriteBlock(block *ckdb.Block) // 写入clickhouse的block
}

type MetricsTableID

type MetricsTableID uint8
const (
	NETWORK_1M MetricsTableID = iota
	NETWORK_MAP_1M

	APPLICATION_1M
	APPLICATION_MAP_1M

	TRAFFIC_POLICY_1M

	NETWORK_1S
	NETWORK_MAP_1S

	APPLICATION_1S
	APPLICATION_MAP_1S

	METRICS_TABLE_ID_MAX
)

func MetricsTableNameToID

func MetricsTableNameToID(name string) MetricsTableID

func (MetricsTableID) TableCode

func (i MetricsTableID) TableCode() Code

func (MetricsTableID) TableName

func (i MetricsTableID) TableName() string

type MiniField

type MiniField struct {

	// 用于区分不同的agent及其不同的pipeline,用于如下场景:
	//   - agent和ingester之间的数据传输
	//   - ingester写入clickhouse,作用类似_id,序列化为_tid
	GlobalThreadID uint8
	IsIPv6         uint8 // 与IP/IP6是共生字段
	L3EpcID        int16
	L3EpcID1       int16

	MAC, MAC1  uint64
	Direction  DirectionEnum
	Protocol   layers.IPProtocol // (8B)
	ACLGID     uint16
	ServerPort uint16
	VTAPID     uint16
	TAPPort    datatype.TapPort
	TAPType    TAPTypeEnum
	L7Protocol datatype.L7Protocol

	TunnelIPID uint16

	AppService  string
	AppInstance string
	// contains filtered or unexported fields
}

func AcquireMiniField

func AcquireMiniField() *MiniField

func CloneMiniField

func CloneMiniField(miniField *MiniField) *MiniField

func (*MiniField) IP

func (f *MiniField) IP() net.IP

func (*MiniField) IP1

func (f *MiniField) IP1() net.IP

func (*MiniField) SetIP

func (f *MiniField) SetIP(ip net.IP)

func (*MiniField) SetIP1

func (f *MiniField) SetIP1(ip net.IP)

func (*MiniField) WriteToPB

func (f *MiniField) WriteToPB(p *pb.MiniField)

type MiniTag

type MiniTag struct {
	*MiniField
	Code
	// contains filtered or unexported fields
}

func AcquireMiniTag

func AcquireMiniTag() *MiniTag

func CloneMiniTag

func CloneMiniTag(miniTag *MiniTag) *MiniTag

CloneMiniTag 需要复制Tag拥有的Field

func (*MiniTag) Clone

func (t *MiniTag) Clone() Tagger

func (*MiniTag) Decode

func (t *MiniTag) Decode(_ *codec.SimpleDecoder)

func (*MiniTag) GetCode

func (t *MiniTag) GetCode() uint64

func (*MiniTag) GetTAPType

func (t *MiniTag) GetTAPType() uint8

func (*MiniTag) MarshalTo

func (t *MiniTag) MarshalTo(b []byte) int

注意: 必须要按tag字段的字典顺序进行处理

func (*MiniTag) Release

func (t *MiniTag) Release()

func (*MiniTag) SetCode

func (t *MiniTag) SetCode(code uint64)

func (*MiniTag) SetID

func (t *MiniTag) SetID(id string)

func (*MiniTag) SetTID

func (t *MiniTag) SetTID(tid uint8)

func (*MiniTag) String

func (t *MiniTag) String() string

func (*MiniTag) ToKVString

func (t *MiniTag) ToKVString() string

只用于调试

func (*MiniTag) WriteToPB

func (t *MiniTag) WriteToPB(p *pb.MiniTag)

type Performance

type Performance struct {
	RetransTx     uint64 `json:"retrans_tx" category:"$metrics"`
	RetransRx     uint64 `json:"retrans_rx" category:"$metrics"`
	ZeroWinTx     uint64 `json:"zero_win_tx" category:"$metrics"`
	ZeroWinRx     uint64 `json:"zero_win_rx" category:"$metrics"`
	RetransSyn    uint32 `json:"retrans_syn" category:"$metrics"`
	RetransSynack uint32 `json:"retrans_synack" category:"$metrics"`
}

func (*Performance) ConcurrentMerge

func (a *Performance) ConcurrentMerge(other *Performance)

func (*Performance) MarshalTo

func (a *Performance) MarshalTo(b []byte) int

func (*Performance) ReadFromPB

func (a *Performance) ReadFromPB(p *pb.Performance)

func (*Performance) Reverse

func (a *Performance) Reverse()

func (*Performance) SequentialMerge

func (a *Performance) SequentialMerge(other *Performance)

func (*Performance) WriteBlock

func (a *Performance) WriteBlock(block *ckdb.Block)

WriteBlock的列和PerformanceColumns需要按顺序一一对应

func (*Performance) WriteToPB

func (a *Performance) WriteToPB(p *pb.Performance)

type SideType

type SideType uint8
const (
	NodeSide SideType = (iota + 1) << 3
	HypervisorSide
	GatewayHypervisorSide
	GatewaySide
	ProcessSide
	AppSide
)

type TAPSideEnum

type TAPSideEnum uint8

func (TAPSideEnum) String

func (s TAPSideEnum) String() string

type TAPTypeEnum

type TAPTypeEnum uint8

TAP: Traffic Access Point

Indicates the flow data collection location. Currently supports 255 acquisition locations. The traffic in cloud is uniformly represented by a special value `3`, and the other values represent the traffic collected from optical splitting and mirroring at different locations in the IDC.

Note: For historical reasons, we use the confusing term VTAP to refer to deepflow-agent, and agent_id to represent the id of a deepflow-agent.

const (
	IDC_MIN TAPTypeEnum = 1 // 1~2, 4~255: IDC
	CLOUD   TAPTypeEnum = 3
)

type Tag

type Tag struct {
	Field
	Code
	// contains filtered or unexported fields
}

func AcquireTag

func AcquireTag() *Tag

func CloneTag

func CloneTag(tag *Tag) *Tag

CloneTag 需要复制Tag拥有的Field

func (*Tag) Clone

func (t *Tag) Clone() Tagger

func (*Tag) DatabaseSuffix

func (t *Tag) DatabaseSuffix() string

func (*Tag) DatabaseSuffixID

func (t *Tag) DatabaseSuffixID() int

func (*Tag) GetCode

func (t *Tag) GetCode() uint64

func (*Tag) GetTAPType

func (t *Tag) GetTAPType() uint8

func (*Tag) MarshalTo

func (t *Tag) MarshalTo(b []byte) int

注意: 必须要按tag字段的字典顺序进行处理

func (*Tag) ReadFromPB

func (t *Tag) ReadFromPB(p *pb.MiniTag)

func (*Tag) Release

func (t *Tag) Release()

func (*Tag) SetCode

func (t *Tag) SetCode(code uint64)

func (*Tag) SetID

func (t *Tag) SetID(id string)

func (*Tag) SetTID

func (t *Tag) SetTID(tid uint8)

func (*Tag) String

func (t *Tag) String() string

func (*Tag) TableID

func (t *Tag) TableID(isSecond bool) (uint8, error)

func (*Tag) ToKVString

func (t *Tag) ToKVString() string

func (*Tag) WriteBlock

func (t *Tag) WriteBlock(block *ckdb.Block, time uint32)

顺序需要和GenTagColumns的一致

type TagSource

type TagSource uint8
const (
	GpId  TagSource = 1 << iota // if the GpId exists but the podId does not exist, first obtain the podId through the GprocessId table delivered by the Controller
	PodId                       // use vtapId + podId to match first
	Mac                         // if vtapId + podId cannot be matched, finally use Mac/EpcIP to match resources
	EpcIP
	Peer            // Multicast, filled with peer information
	Agent           // traffic on the 'lo' port uses the Agent's IP and Epc to match resource information.
	None  TagSource = 0
)

type Tagger

type Tagger interface {
	SetID(string)
	GetCode() uint64
	SetCode(uint64)
	GetTAPType() uint8
	ToKVString() string
	MarshalTo([]byte) int
	String() string
	Clone() Tagger
	Release()
}

type Traffic

type Traffic struct {
	PacketTx   uint64 `json:"packet_tx" category:"$metrics" sub:"l3_throughput"`
	PacketRx   uint64 `json:"packet_rx" category:"$metrics" sub:"l3_throughput"`
	ByteTx     uint64 `json:"byte_tx" category:"$metrics" sub:"l3_throughput"`
	ByteRx     uint64 `json:"byte_rx" category:"$metrics" sub:"l3_throughput"`
	L3ByteTx   uint64 `json:"l3_byte_tx" category:"$metrics" sub:"l3_throughput"`
	L3ByteRx   uint64 `json:"l3_byte_rx" category:"$metrics" sub:"l3_throughput"`
	L4ByteTx   uint64 `json:"l4_byte_tx" category:"$metrics" sub:"l4_throughput"`
	L4ByteRx   uint64 `json:"l4_byte_rx" category:"$metrics" sub:"l4_throughput"`
	NewFlow    uint64 `json:"new_flow" category:"$metrics" sub:"l4_throughput"`
	ClosedFlow uint64 `json:"closed_flow" category:"$metrics" sub:"l4_throughput"`

	L7Request   uint32 `json:"l7_request" category:"$metrics" sub:"application"`
	L7Response  uint32 `json:"l7_response" category:"$metrics" sub:"application"`
	SynCount    uint32 `json:"syn_count" category:"$metrics" sub:"l4_throughput"`
	SynackCount uint32 `json:"synack_count" category:"$metrics" sub:"l4_throughput"`

	DirectionScore uint8 `json:"direction_score" category:"$metrics" sub:"l4_throughput"`
}

func (*Traffic) ConcurrentMerge

func (t *Traffic) ConcurrentMerge(other *Traffic)

func (*Traffic) MarshalTo

func (t *Traffic) MarshalTo(b []byte) int

func (*Traffic) ReadFromPB

func (t *Traffic) ReadFromPB(p *pb.Traffic)

func (*Traffic) Reverse

func (t *Traffic) Reverse()

func (*Traffic) SequentialMerge

func (t *Traffic) SequentialMerge(other *Traffic)

func (*Traffic) WriteBlock

func (t *Traffic) WriteBlock(block *ckdb.Block)

WriteBlock的列需和Columns 按顺序一一对应

func (*Traffic) WriteToPB

func (t *Traffic) WriteToPB(p *pb.Traffic)

type UniversalTag

type UniversalTag struct {
	IP6            net.IP // FIXME: merge IP6 and IP
	IP             uint32
	L3EpcID        int32 // (8B)
	L3DeviceID     uint32
	RegionID       uint16
	SubnetID       uint16
	HostID         uint16
	AZID           uint16
	PodClusterID   uint16
	PodNSID        uint16
	PodID          uint32
	PodNodeID      uint32
	PodGroupID     uint32
	ServiceID      uint32
	AutoInstanceID uint32
	AutoServiceID  uint32
	GPID           uint32

	IsIPv6           uint8
	L3DeviceType     DeviceType
	AutoInstanceType uint8
	AutoServiceType  uint8

	VTAPID uint16
}

func (*UniversalTag) WriteBlock

func (t *UniversalTag) WriteBlock(block *ckdb.Block)

Note: The order of Write() must be consistent with the order of append() in GenUniversalTagColumns. Currently all fields are sorted lexicographically by name.

type UsageMeter

type UsageMeter struct {
	PacketTx uint64 `json:"packet_tx" category:"$metrics" sub:"NPB"`
	PacketRx uint64 `json:"packet_rx" category:"$metrics" sub:"NPB"`
	ByteTx   uint64 `json:"byte_tx" category:"$metrics" sub:"NPB"`
	ByteRx   uint64 `json:"byte_rx" category:"$metrics" sub:"NPB"`
	L3ByteTx uint64 `json:"l3_byte_tx" category:"$metrics" sub:"NPB"`
	L3ByteRx uint64 `json:"l3_byte_rx" category:"$metrics" sub:"NPB"`
	L4ByteTx uint64 `json:"l4_byte_tx" category:"$metrics" sub:"NPB"`
	L4ByteRx uint64 `json:"l4_byte_rx" category:"$metrics" sub:"NPB"`
}

func (*UsageMeter) ConcurrentMerge

func (m *UsageMeter) ConcurrentMerge(other Meter)

func (*UsageMeter) ID

func (m *UsageMeter) ID() uint8

func (*UsageMeter) MarshalTo

func (m *UsageMeter) MarshalTo(b []byte) int

func (*UsageMeter) Merge

func (m *UsageMeter) Merge(other *UsageMeter)

func (*UsageMeter) Name

func (m *UsageMeter) Name() string

func (*UsageMeter) ReadFromPB

func (m *UsageMeter) ReadFromPB(p *pb.UsageMeter)

func (*UsageMeter) Reverse

func (m *UsageMeter) Reverse()

func (*UsageMeter) SequentialMerge

func (m *UsageMeter) SequentialMerge(other Meter)

func (*UsageMeter) SortKey

func (m *UsageMeter) SortKey() uint64

func (*UsageMeter) ToKVString

func (m *UsageMeter) ToKVString() string

func (*UsageMeter) VTAPName

func (m *UsageMeter) VTAPName() string

func (*UsageMeter) WriteBlock

func (m *UsageMeter) WriteBlock(block *ckdb.Block)

WriteBlock需要和Colums的列一一对应

func (*UsageMeter) WriteToPB

func (m *UsageMeter) WriteToPB(p *pb.UsageMeter)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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