decoder

package
v0.0.0-...-7a653dd Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BUFFER_SIZE    = 128 // An prometheus message is usually very large, so use a smaller value than usual
	PROMETHEUS_POD = "pod"
)
View Source
const (
	METRICID_OFFSET = 32 // when generate columnIndexKey/metricTargetPairKey, high32 is metricID, low32 can be labelNameID/targetID

	MAX_ORG_COUNT = ckdb.MAX_ORG_ID + 1
)

Variables

This section is empty.

Functions

func DecodeWriteRequest

func DecodeWriteRequest(compressed []byte, decodeBuffer *[]byte, req *prompb.WriteRequest) error

func RegisterClientPrometheusLabelCommand

func RegisterClientPrometheusLabelCommand() *cobra.Command

func ReleaseSlowItem

func ReleaseSlowItem(s *SlowItem)

Types

type BuilderCounter

type BuilderCounter struct {
	TimeSeriesIn      int64 `statsd:"time-series-in"`
	TimeSeriesInvaild int64 `statsd:"time-series-invalid"`
	EpcMiss           int64 `statsd:"epc-miss"`
	LabelCount        int64 `statsd:"label-in"`
	MetricMiss        int64 `statsd:"metirc-miss"`
	NameMiss          int64 `statsd:"name-miss"`
	ValueMiss         int64 `statsd:"value-miss"`
	NameValueMiss     int64 `statsd:"name-value-miss"`
	ColumnMiss        int64 `statsd:"column-miss"`
	TargetMiss        int64 `statsd:"target-miss"`
	MetricTargetMiss  int64 `statsd:"metric-target-miss"`
	Sample            int64 `statsd:"sample-out"`
}

type Counter

type Counter struct {
	InCount        int64 `statsd:"in-count"`
	OutCount       int64 `statsd:"out-count"`
	ErrCount       int64 `statsd:"err-count"`
	TimeSeriesIn   int64 `statsd:"time-series-in"`
	TimeSeriesErr  int64 `statsd:"time-series-err"`
	TimeSeriesSlow int64 `statsd:"time-series-slow"`
	TimeSeriesOut  int64 `statsd:"time-series-out"` // count the number of TimeSeries (not Samples)
}

type Decoder

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

func NewDecoder

func NewDecoder(
	index int,
	platformData *grpc.PlatformInfoTable,
	prometheusLabelTable *PrometheusLabelTable,
	inQueue queue.QueueReader,
	slowDecodeQueue queue.QueueWriter,
	prometheusWriter *dbwriter.PrometheusWriter,
	config *config.Config,
) *Decoder

func (*Decoder) GetCounter

func (d *Decoder) GetCounter() interface{}

func (*Decoder) Run

func (d *Decoder) Run()

type PrometheusLabelTable

type PrometheusLabelTable struct {
	GrpcSession *grpc.GrpcSession

	utils.Closable
	// contains filtered or unexported fields
}

func NewPrometheusLabelTable

func NewPrometheusLabelTable(controllerIPs []string, port, rpcMaxMsgSize, cacheExpiration int) *PrometheusLabelTable

func (*PrometheusLabelTable) DropOrg

func (t *PrometheusLabelTable) DropOrg(orgId uint16)

func (*PrometheusLabelTable) GetCounter

func (t *PrometheusLabelTable) GetCounter() interface{}

func (*PrometheusLabelTable) GetMaxAppLabelColumnIndex

func (t *PrometheusLabelTable) GetMaxAppLabelColumnIndex() int

func (*PrometheusLabelTable) HandleSimpleCommand

func (t *PrometheusLabelTable) HandleSimpleCommand(op uint16, args string) string

func (*PrometheusLabelTable) QueryColumnIndex

func (t *PrometheusLabelTable) QueryColumnIndex(orgId uint16, metricID, labelNameID uint32) (uint32, bool)

func (*PrometheusLabelTable) QueryLabelNameID

func (t *PrometheusLabelTable) QueryLabelNameID(orgId uint16, labelName string) (uint32, bool)

func (*PrometheusLabelTable) QueryLabelNameValue

func (t *PrometheusLabelTable) QueryLabelNameValue(orgId uint16, nameId, valueId uint32) bool

func (*PrometheusLabelTable) QueryLabelValueID

func (t *PrometheusLabelTable) QueryLabelValueID(orgId uint16, labelValue string) (uint32, bool)

func (*PrometheusLabelTable) QueryMetricID

func (t *PrometheusLabelTable) QueryMetricID(orgId uint16, metricName string) (uint32, bool)

func (*PrometheusLabelTable) RequestAllLabelIDs

func (t *PrometheusLabelTable) RequestAllLabelIDs(version uint32)

func (*PrometheusLabelTable) RequestLabelIDs

func (*PrometheusLabelTable) UpdateAllLabelsRegularIntervals

func (t *PrometheusLabelTable) UpdateAllLabelsRegularIntervals()

type PrometheusSamplesBuilder

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

func NewPrometheusSamplesBuilder

func NewPrometheusSamplesBuilder(name string, index int, platformData *grpc.PlatformInfoTable, labelTable *PrometheusLabelTable, appLabelColumnAlign int, ignoreUniversalTag bool) *PrometheusSamplesBuilder

func (*PrometheusSamplesBuilder) GetCounter

func (d *PrometheusSamplesBuilder) GetCounter() interface{}

func (*PrometheusSamplesBuilder) GetEpcPodClusterId

func (b *PrometheusSamplesBuilder) GetEpcPodClusterId(orgId, vtapID uint16) (uint16, uint16, error)

func (*PrometheusSamplesBuilder) TimeSeriesToStore

func (b *PrometheusSamplesBuilder) TimeSeriesToStore(vtapID, epcId, podClusterId, orgId, teamID uint16, ts *prompb.TimeSeries, extraLabels []prompb.Label) (bool, error)

if success,return false,nil if failed, return false,err if isSlow, return true,slowReason

type RequestCounter

type RequestCounter struct {
	RequestCount        int64  `statsd:"request-count"`
	RequestTotalDelayNs int64  `statsd:"request-total-delay-ns"`
	ResponseFailed      int64  `statsd:"response-failed"`
	RequestLabelsCount  int64  `statsd:"request-labels-count"`
	ResponseLabelsCount int64  `statsd:"response-labels-count"`
	MetricUnknown       uint64 `statsd:"metric-unknown"`
	LabelNameUnknown    uint64 `statsd:"label-name-unknown"`
	LabelValueUnknown   uint64 `statsd:"label-value-unknown"`
	CacheExpiration     uint64 `statsd:"cache-expiration-count"`
}

type SlowCounter

type SlowCounter struct {
	// count the number of TimeSeries (not Samples)
	TimeSeriesIn   int64 `statsd:"time-series-in"`
	TimeSeriesErr  int64 `statsd:"time-series-err"`
	TimeSeriesDrop int64 `statsd:"time-series-drop"`
	TimeSeriesOut  int64 `statsd:"time-series-out"`

	SampleOut    int64 `statsd:"sample-out"` // count the number of Samples (not TimeSeries)
	RequestCount int64 `statsd:"request-count"`
}

type SlowDecoder

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

func NewSlowDecoder

func NewSlowDecoder(
	index int,
	platformData *grpc.PlatformInfoTable,
	prometheusLabelTable *PrometheusLabelTable,
	inQueue queue.QueueReader,
	prometheusWriter *dbwriter.PrometheusWriter,
	config *config.Config,
) *SlowDecoder

func (*SlowDecoder) GetCounter

func (d *SlowDecoder) GetCounter() interface{}

func (*SlowDecoder) Run

func (d *SlowDecoder) Run()

func (*SlowDecoder) TimeSeriesToLableIDRequest

func (d *SlowDecoder) TimeSeriesToLableIDRequest(ts *prompb.TimeSeries, epcId, podClusterId, orgId uint16) *trident.MetricLabelRequest

type SlowItem

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

func AcquireSlowItem

func AcquireSlowItem(vtapId, epcId, podClusterId, orgId, teamId uint16, ts *prompb.TimeSeries, extraLabels []prompb.Label) *SlowItem

Jump to

Keyboard shortcuts

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