Documentation
¶
Index ¶
- type MetricTracker
- type ScopeTracker
- type Tracker
- func (t *Tracker) AppendBinary(b []byte) ([]byte, error)
- func (t *Tracker) CheckOverflow(f func() hash.Hash64) bool
- func (t *Tracker) Equal(other *Tracker) bool
- func (t *Tracker) EstimateOverflow() uint64
- func (t *Tracker) HasOverflow() bool
- func (t *Tracker) MergeEstimators(other *Tracker) error
- func (t *Tracker) Unmarshal(d []byte) (int, error)
- type Trackers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetricTracker ¶ added in v0.6.0
type MetricTracker struct { *Tracker // contains filtered or unexported fields }
MetricTracker tracks cardinality for metrics. They have a nested structure to track the cardinality of each datapoint for the metrics.
func (*MetricTracker) GetDatapointTracker ¶ added in v0.6.0
func (mt *MetricTracker) GetDatapointTracker(i int) *Tracker
GetDatapointTracker returns a datapoint tracker from the index of the datapoint in the `pmetric.Metrics` slice of the `pmetric.Metrics` model.
func (*MetricTracker) NewDatapointTracker ¶ added in v0.6.0
func (mt *MetricTracker) NewDatapointTracker() *Tracker
NewDatapointTracker creates a new datapoint tracker to track datapoint cardinality for the datapoints within the current metrics.
type ScopeTracker ¶ added in v0.6.0
type ScopeTracker struct { *Tracker // contains filtered or unexported fields }
ScopeTracker tracks cardinality for scope metrics. They have a nested structure to track cardinality for each metrics for the scope and datapoints for the metrics.
func (*ScopeTracker) GetMetricTracker ¶ added in v0.6.0
func (st *ScopeTracker) GetMetricTracker(i int) *MetricTracker
GetMetricTracker returns a metric tracker from the index of the metric in the `pmetric.ScopeMetrics` slice of the `pmetric.Metrics` model.
func (*ScopeTracker) NewMetricTracker ¶ added in v0.6.0
func (st *ScopeTracker) NewMetricTracker() *MetricTracker
NewMetricTracker creates new metric trackers to track metrics cardinality for the metrics within the current scope.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker tracks the configured limits while merging. It records the observed count as well as the unique overflow counts.
func (*Tracker) AppendBinary ¶ added in v0.5.0
AppendBinary marshals the tracker and appends the result to b.
func (*Tracker) CheckOverflow ¶
CheckOverflow checks if overflow will happen on addition of a new entry with the provided hash denoting the entries ID. It assumes that any entry passed to this method is a NEW entry and the check for this is left to the caller.
func (*Tracker) EstimateOverflow ¶
func (*Tracker) HasOverflow ¶
func (*Tracker) MergeEstimators ¶
MergeEstimators merges the overflow estimators for the two trackers. Note that other required maintenance of the tracker for merge needs to done by the caller.
type Trackers ¶
type Trackers struct {
// contains filtered or unexported fields
}
Trackers represent multiple tracker in an ordered structure. It takes advantage of the fact that pmetric DS is ordered and thus allows trackers to be created for each resource, scope, and datapoint independent of the pmetric datastructure. Note that this means that the order for pmetric and trackers are implicitly related and removing/adding new objects to pmetric should be accompanied by adding a corresponding tracker. The different types of trackers are:
- Resource tracker: one for each `pmetric.Metrics`, tracks the cardinality of resources as per the configured limit.
- Scope tracker: one for each `pmetric.ResourceMetrics`, tracks the cardinality of scopes within a resource as per the configured limit.
- Metric tracker: one for each `pmetric.ScopeMetrics`, tracks the cardinality of metrics within a scope as per the configured limit.
- Datapoint tracker: one for each `pmetric.Metric`, tracks the cardinality of datapoints within a metric as per the configured limit.
func NewTrackers ¶
NewTrackers creates trackers based on the configured overflow limits.
func (*Trackers) AppendBinary ¶ added in v0.5.0
func (*Trackers) GetResourceTracker ¶
GetResourceTracker returns the resource tracker.
func (*Trackers) GetScopeTracker ¶
func (t *Trackers) GetScopeTracker(i int) *ScopeTracker
GetScopeTracker returns the scope tracker based on the index of the resouce metrics whose scopes are to be tracked in the `pmetric.ResourceMetrics` slice of the `pmetric.Metrics` datamodel for the resource whose scopes are being tracked.
func (*Trackers) NewScopeTracker ¶
func (t *Trackers) NewScopeTracker() *ScopeTracker