Documentation ¶
Index ¶
- Variables
- type BoundCounter
- type BoundGauge
- type BoundHistogram
- func (h *BoundHistogram) Update(f func())
- func (h *BoundHistogram) UpdateDuration(d time.Duration)
- func (h *BoundHistogram) UpdateMilliseconds(s float64)
- func (h *BoundHistogram) UpdateSeconds(s float64)
- func (h *BoundHistogram) UpdateSince(start time.Time)
- func (h *BoundHistogram) WithExponentBuckets(lower, upper time.Duration, count int) *BoundHistogram
- func (h *BoundHistogram) WithLinearBuckets(lower, upper time.Duration, count int) *BoundHistogram
- type BoundMax
- type BoundMin
- type DeltaCounterVec
- type DeltaHistogramVec
- type Gather
- type GatherOption
- type GaugeVec
- type MaxVec
- type MinVec
- type Observer
- type Registry
- type Scope
Constants ¶
This section is empty.
Variables ¶
var ( // RootRegistry represents root level metric Registry. RootRegistry = &Registry{ series: make(map[uint64]*taggedSeries), } // BrokerRegistry represents broker level metric Registry. BrokerRegistry = &Registry{ series: make(map[uint64]*taggedSeries), } // StorageRegistry represents storage level metric Registry. StorageRegistry = &Registry{ series: make(map[uint64]*taggedSeries), } )
Functions ¶
This section is empty.
Types ¶
type BoundCounter ¶
type BoundCounter struct {
// contains filtered or unexported fields
}
BoundCounter is a counter which has been Bound to a certain metric with field-name and metrics, it does not support update method. Get will resets the underlying delta value
func (*BoundCounter) Get ¶
func (c *BoundCounter) Get() float64
Get returns the current delta counter value
type BoundGauge ¶
type BoundGauge struct {
// contains filtered or unexported fields
}
BoundGauge is a gauge which has Bound to a certain metric with field-name and tags
func (*BoundGauge) SetGetValueFn ¶
func (g *BoundGauge) SetGetValueFn(fn func(val *atomic.Float64))
SetGetValueFn sets get value callback, when Get/gather invokes this callback for getting new value.
func (*BoundGauge) Update ¶
func (g *BoundGauge) Update(v float64)
Update updates gauge with a new value
type BoundHistogram ¶
type BoundHistogram struct {
// contains filtered or unexported fields
}
BoundHistogram is a histogram which has been Bound to a certain metric with field-name and metrics, used for non-negative values
a default created bucket will be automatically created, however, you can also specify your own buckets. Prometheus Histogram's buckets are cumulative where values in each buckets is cumulative,
func NewHistogram ¶
func NewHistogram() *BoundHistogram
func (*BoundHistogram) Update ¶
func (h *BoundHistogram) Update(f func())
func (*BoundHistogram) UpdateDuration ¶
func (h *BoundHistogram) UpdateDuration(d time.Duration)
func (*BoundHistogram) UpdateMilliseconds ¶
func (h *BoundHistogram) UpdateMilliseconds(s float64)
func (*BoundHistogram) UpdateSeconds ¶
func (h *BoundHistogram) UpdateSeconds(s float64)
func (*BoundHistogram) UpdateSince ¶
func (h *BoundHistogram) UpdateSince(start time.Time)
func (*BoundHistogram) WithExponentBuckets ¶
func (h *BoundHistogram) WithExponentBuckets(lower, upper time.Duration, count int) *BoundHistogram
func (*BoundHistogram) WithLinearBuckets ¶
func (h *BoundHistogram) WithLinearBuckets(lower, upper time.Duration, count int) *BoundHistogram
type DeltaCounterVec ¶
type DeltaCounterVec struct {
// contains filtered or unexported fields
}
func NewCounterVec ¶
func (*DeltaCounterVec) WithTagValues ¶
func (dcv *DeltaCounterVec) WithTagValues(tagValues ...string) *BoundCounter
type DeltaHistogramVec ¶
type DeltaHistogramVec struct {
// contains filtered or unexported fields
}
func NewHistogramVec ¶
func (*DeltaHistogramVec) WithExponentBuckets ¶
func (hv *DeltaHistogramVec) WithExponentBuckets(lower, upper time.Duration, count int) *DeltaHistogramVec
func (*DeltaHistogramVec) WithLinearBuckets ¶
func (hv *DeltaHistogramVec) WithLinearBuckets(lower, upper time.Duration, count int) *DeltaHistogramVec
func (*DeltaHistogramVec) WithTagValues ¶
func (hv *DeltaHistogramVec) WithTagValues(tagValues ...string) *BoundHistogram
type GatherOption ¶
type GatherOption interface {
ApplyConfig(g *gather)
}
func WithGlobalKeyValueOption ¶
func WithGlobalKeyValueOption(kvs tag.Tags) GatherOption
func WithNamespaceOption ¶
func WithNamespaceOption(namespace string) GatherOption
func WithReadRuntimeOption ¶
func WithReadRuntimeOption(observer Observer) GatherOption
type GaugeVec ¶
type GaugeVec struct {
// contains filtered or unexported fields
}
func (*GaugeVec) WithTagValues ¶
func (gv *GaugeVec) WithTagValues(tagValues ...string) *BoundGauge
type MaxVec ¶
type MaxVec struct {
// contains filtered or unexported fields
}
func (*MaxVec) WithTagValues ¶
type MinVec ¶
type MinVec struct {
// contains filtered or unexported fields
}
func (*MinVec) WithTagValues ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a set of metrics Metrics in this Registry will be exported to LinDB's native ingestion.
func (*Registry) FindMetricList ¶
func (r *Registry) FindMetricList(names []string, includeTags map[string]string) map[string][]*models.StateMetric
FindMetricList returns metric list by given names/tags.
func (*Registry) NewGather ¶
func (r *Registry) NewGather(options ...GatherOption) Gather
NewGather returns a gather to gather metrics from sdk and runtime.
type Scope ¶
type Scope interface { // Scope returns a child scope Scope(name string, tagList ...string) Scope // NewGauge returns a fast gauge which bounded to the scope NewGauge(fieldName string) *BoundGauge // NewCounter returns a fast counter which bounded to the scope NewCounter(fieldName string) *BoundCounter // NewMax returns a fast max which bounded to the scope NewMax(fieldName string) *BoundMax // NewMin returns a fast min which bounded to the scope NewMin(fieldName string) *BoundMin // NewHistogram returns a histogram which bounded to the scope NewHistogram() *BoundHistogram // NewHistogramVec initializes a vec by tagKeys NewHistogramVec(tagKey ...string) *DeltaHistogramVec // NewCounterVec initializes a vec by tagKeys and fieldName NewCounterVec(fieldName string, tagKey ...string) *DeltaCounterVec // NewGaugeVec initializes a vec by tagKeys and fieldName NewGaugeVec(fieldName string, tagKey ...string) *GaugeVec // NewMaxVec initializes a vec by tagKeys and fieldName NewMaxVec(fieldName string, tagKey ...string) *MaxVec // NewMinVec initializes a vec by tagKeys and fieldName NewMinVec(fieldName string, tagKey ...string) *MinVec }
Scope is a namespace wrapper for linmetric. ensure that all emitted metric have a given prefix and tags. NewsScope("lindb").Scope("runtime").Scope("mem") make a point-concated metric-name: lindb.runtime.mem