Documentation ¶
Index ¶
- Constants
- func ReleasePrometheusSample(p *PrometheusSample)
- func ReleasePrometheusSampleMini(p *PrometheusSampleMini)
- type ClusterNode
- type Counter
- type PrometheusSample
- func (m *PrometheusSample) Columns(appLabelColumnCount int) []*ckdb.Column
- func (m *PrometheusSample) DatabaseName() string
- func (m *PrometheusSample) GenCKTable(cluster, storagePolicy string, ttl int, coldStorage *ckdb.ColdStorage, ...) *ckdb.Table
- func (m *PrometheusSample) GenerateNewFlowTags(cache *flow_tag.FlowTagCache, metricName string, timeSeries *prompb.TimeSeries, ...)
- func (m *PrometheusSample) PodNsId() uint16
- func (m *PrometheusSample) Release()
- func (m *PrometheusSample) TableName() string
- func (m *PrometheusSample) VpcId() int32
- func (m *PrometheusSample) WriteBlock(block *ckdb.Block)
- type PrometheusSampleInterface
- type PrometheusSampleMini
- func (m *PrometheusSampleMini) AppLabelLen() int
- func (m *PrometheusSampleMini) Columns(appLabelColumnCount int) []*ckdb.Column
- func (m *PrometheusSampleMini) DatabaseName() string
- func (m *PrometheusSampleMini) GenCKTable(cluster, storagePolicy string, ttl int, coldStorage *ckdb.ColdStorage, ...) *ckdb.Table
- func (m *PrometheusSampleMini) GenerateNewFlowTags(cache *flow_tag.FlowTagCache, metricName string, timeSeries *prompb.TimeSeries, ...)
- func (m *PrometheusSampleMini) PodNsId() uint16
- func (m *PrometheusSampleMini) Release()
- func (m *PrometheusSampleMini) TableName() string
- func (m *PrometheusSampleMini) VpcId() int32
- func (m *PrometheusSampleMini) WriteBlock(block *ckdb.Block)
- type PrometheusWriter
Constants ¶
const ( DefaultPartition = ckdb.TimeFuncTwoHour MAX_APP_LABEL_COLUMN_INDEX = 256 )
const ( QUEUE_BATCH_SIZE = 1024 PROMETHEUS_DB = "prometheus" PROMETHEUS_TABLE = "samples" )
Variables ¶
This section is empty.
Functions ¶
func ReleasePrometheusSample ¶
func ReleasePrometheusSample(p *PrometheusSample)
func ReleasePrometheusSampleMini ¶
func ReleasePrometheusSampleMini(p *PrometheusSampleMini)
Types ¶
type ClusterNode ¶
type PrometheusSample ¶
type PrometheusSample struct { PrometheusSampleMini UniversalTag zerodoc.UniversalTag }
func AcquirePrometheusSample ¶
func AcquirePrometheusSample() *PrometheusSample
func (*PrometheusSample) Columns ¶
func (m *PrometheusSample) Columns(appLabelColumnCount int) []*ckdb.Column
Note: The order of append() must be consistent with the order of Write() in WriteBlock.
func (*PrometheusSample) DatabaseName ¶
func (m *PrometheusSample) DatabaseName() string
func (*PrometheusSample) GenCKTable ¶
func (m *PrometheusSample) GenCKTable(cluster, storagePolicy string, ttl int, coldStorage *ckdb.ColdStorage, appLabelColumnCount int) *ckdb.Table
func (*PrometheusSample) GenerateNewFlowTags ¶
func (m *PrometheusSample) GenerateNewFlowTags(cache *flow_tag.FlowTagCache, metricName string, timeSeries *prompb.TimeSeries, extraLabels []prompb.Label, tsLabelNameIDs, tsLabelValueIDs []uint32)
Check if there is a TagName/TagValue/MetricsName not in fieldCache or fieldValueCache, and store the newly appeared item in cache.
func (*PrometheusSample) PodNsId ¶
func (m *PrometheusSample) PodNsId() uint16
func (*PrometheusSample) Release ¶
func (m *PrometheusSample) Release()
func (*PrometheusSample) TableName ¶
func (m *PrometheusSample) TableName() string
func (*PrometheusSample) VpcId ¶
func (m *PrometheusSample) VpcId() int32
func (*PrometheusSample) WriteBlock ¶
func (m *PrometheusSample) WriteBlock(block *ckdb.Block)
Note: The order of Write() must be consistent with the order of append() in Columns.
type PrometheusSampleInterface ¶
type PrometheusSampleInterface interface { DatabaseName() string TableName() string WriteBlock(*ckdb.Block) Columns(int) []*ckdb.Column AppLabelLen() int GenCKTable(string, string, int, *ckdb.ColdStorage, int) *ckdb.Table GenerateNewFlowTags(*flow_tag.FlowTagCache, string, *prompb.TimeSeries, []prompb.Label, []uint32, []uint32) VpcId() int32 PodNsId() uint16 Release() }
type PrometheusSampleMini ¶
type PrometheusSampleMini struct { Timestamp uint32 // s MetricID uint32 TargetID uint32 AppLabelValueIDs []uint32 Value float64 }
func AcquirePrometheusSampleMini ¶
func AcquirePrometheusSampleMini() *PrometheusSampleMini
func (*PrometheusSampleMini) AppLabelLen ¶
func (m *PrometheusSampleMini) AppLabelLen() int
func (*PrometheusSampleMini) Columns ¶
func (m *PrometheusSampleMini) Columns(appLabelColumnCount int) []*ckdb.Column
Note: The order of append() must be consistent with the order of Write() in WriteBlock.
func (*PrometheusSampleMini) DatabaseName ¶
func (m *PrometheusSampleMini) DatabaseName() string
func (*PrometheusSampleMini) GenCKTable ¶
func (m *PrometheusSampleMini) GenCKTable(cluster, storagePolicy string, ttl int, coldStorage *ckdb.ColdStorage, appLabelColumnCount int) *ckdb.Table
func (*PrometheusSampleMini) GenerateNewFlowTags ¶
func (m *PrometheusSampleMini) GenerateNewFlowTags(cache *flow_tag.FlowTagCache, metricName string, timeSeries *prompb.TimeSeries, extraLabels []prompb.Label, tsLabelNameIDs, tsLabelValueIDs []uint32)
Check if there is a TagName/TagValue/MetricsName not in fieldCache or fieldValueCache, and store the newly appeared item in cache.
func (*PrometheusSampleMini) PodNsId ¶
func (m *PrometheusSampleMini) PodNsId() uint16
func (*PrometheusSampleMini) Release ¶
func (m *PrometheusSampleMini) Release()
func (*PrometheusSampleMini) TableName ¶
func (m *PrometheusSampleMini) TableName() string
func (*PrometheusSampleMini) VpcId ¶
func (m *PrometheusSampleMini) VpcId() int32
func (*PrometheusSampleMini) WriteBlock ¶
func (m *PrometheusSampleMini) WriteBlock(block *ckdb.Block)
Note: The order of Write() must be consistent with the order of append() in Columns.
type PrometheusWriter ¶
func NewPrometheusWriter ¶
func (*PrometheusWriter) GetCounter ¶
func (w *PrometheusWriter) GetCounter() interface{}
func (*PrometheusWriter) InitTable ¶
func (w *PrometheusWriter) InitTable(appLabelCount int) error
func (*PrometheusWriter) WriteBatch ¶
func (w *PrometheusWriter) WriteBatch(batch []interface{}, metricName string, timeSeries *prompb.TimeSeries, extraLabels []prompb.Label, tsLabelNameIDs, tsLabelValueIDs []uint32)
This function can be called when the FlowTags in the batch are the same (e.g. Prometheus metrics).