Documentation
¶
Index ¶
- type StatRecord
- type StatsResult
- type Tracker
- func (mt *Tracker) GetStats(limit, le int, matchPattern string) StatsResult
- func (mt *Tracker) GetStatsForTenant(accountID, projectID uint32, limit, le int, matchPattern string) StatsResult
- func (mt *Tracker) IsEmpty() bool
- func (mt *Tracker) MustClose()
- func (mt *Tracker) RegisterIngestRequest(accountID, projectID uint32, metricName []byte)
- func (mt *Tracker) RegisterQueryRequest(accountID, projectID uint32, metricName []byte)
- func (mt *Tracker) Reset(onReset func())
- func (mt *Tracker) UpdateMetrics(dst *TrackerMetrics)
- type TrackerMetrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StatRecord ¶
StatRecord defines stat record for given metric name
type StatsResult ¶
type StatsResult struct { CollectedSinceTs uint64 TotalRecords uint64 MaxSizeBytes uint64 CurrentSizeBytes uint64 Records []StatRecord }
StatsResult defines stats result for GetStats request
func (*StatsResult) DeduplicateMergeRecords ¶
func (sr *StatsResult) DeduplicateMergeRecords()
DeduplicateMergeRecords performs merging duplicate records by metric name
It is usual case for global tenant request at cluster version.
func (*StatsResult) Merge ¶
func (sr *StatsResult) Merge(src *StatsResult)
Merge adds records from given src
It expected src to be sorted by metricName
func (*StatsResult) Sort ¶
func (sr *StatsResult) Sort()
Sort sorts records by metric name and requests count
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker implements in-memory tracker for timeseries metric names it tracks ingest and query requests for metric names and collects statistics
main purpose of this tracker is to provide insights about metrics that have never been queried
func MustLoadFrom ¶
MustLoadFrom inits tracker from the given on-disk path
func (*Tracker) GetStats ¶
func (mt *Tracker) GetStats(limit, le int, matchPattern string) StatsResult
GetStats returns stats response for the tracked metrics
DeduplicateMergeRecords must be called at cluster version on returned result.
func (*Tracker) GetStatsForTenant ¶
func (mt *Tracker) GetStatsForTenant(accountID, projectID uint32, limit, le int, matchPattern string) StatsResult
GetStatsForTenant returns stats response for the tracked metrics for given tenant
func (*Tracker) MustClose ¶
func (mt *Tracker) MustClose()
MustClose closes tracker and saves state on disk
func (*Tracker) RegisterIngestRequest ¶
RegisterIngestRequest tracks metric name ingestion
func (*Tracker) RegisterQueryRequest ¶
RegisterQueryRequest tracks metric name at query request
func (*Tracker) Reset ¶
func (mt *Tracker) Reset(onReset func())
Reset cleans stats, saves cache state and executes provided func
func (*Tracker) UpdateMetrics ¶
func (mt *Tracker) UpdateMetrics(dst *TrackerMetrics)
UpdateMetrics writes internal metrics to the provided object
type TrackerMetrics ¶
TrackerMetrics holds metrics to report