Documentation ¶
Index ¶
- type AggregationFunc
- type Attribute
- type Attributes
- type AttributesKey
- type Filter
- func (f Filter) And(operands ...genq.FilterFunc[Metric]) Filter
- func (f Filter) Group(fn GroupFunc) Group[string]
- func (f Filter) Metrics() Metrics
- func (f Filter) Or(operands ...genq.FilterFunc[Metric]) Filter
- func (f Filter) Resolve() []Metric
- func (f Filter) Where(operands ...genq.FilterFunc[Metric]) Filter
- type FilterFunc
- func And(operands ...FilterFunc) FilterFunc
- func Attr(name string, value string) FilterFunc
- func False() FilterFunc
- func Kind(kind MetricKind) FilterFunc
- func Name(name string) FilterFunc
- func NonZero() FilterFunc
- func Not(fn FilterFunc) FilterFunc
- func Or(operands ...FilterFunc) FilterFunc
- func Prefix(prefix string) FilterFunc
- func Scope(scope string) FilterFunc
- func True() FilterFunc
- type Group
- func (a Group[K]) Aggregate(fn AggregationFunc) map[K]Metric
- func (a Group[K]) AggregateFlat(fn AggregationFunc) Metrics
- func (a Group[K]) Float(fn AggregationFunc) map[K]float64
- func (a Group[K]) FloatSum() map[K]float64
- func (a Group[K]) Int(fn AggregationFunc) map[K]int64
- func (a Group[K]) IntSum() map[K]int64
- type GroupFunc
- type Metric
- type MetricAggregationFunc
- type MetricKey
- type MetricKind
- type Metrics
- func (m Metrics) Add(sets ...Source) Metrics
- func (m Metrics) First() *Metric
- func (m Metrics) FloatSum() float64
- func (m Metrics) Floats() []float64
- func (m Metrics) Group(fn GroupFunc) Group[string]
- func (m Metrics) IntSum() int64
- func (m Metrics) Ints() []int64
- func (m Metrics) Merge(with ...Source) Group[MetricKey]
- func (m Metrics) Resolve() []Metric
- func (m Metrics) Sub(sets ...Source) Metrics
- func (m Metrics) Where(operands ...FilterFunc) Filter
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregationFunc ¶
type AggregationFunc = genq.AggregationFunc[float64]
func Max ¶
func Max() AggregationFunc
func Mean ¶
func Mean() AggregationFunc
func Median ¶
func Median() AggregationFunc
func Min ¶
func Min() AggregationFunc
func StatsAggregation ¶
func StatsAggregation(f func(input stats.Float64Data) (float64, error)) AggregationFunc
func Sub ¶
func Sub() AggregationFunc
Sub subtracts sum of all sets after the first one from the first set.
func Sum ¶
func Sum() AggregationFunc
type Attributes ¶
type Attributes struct {
// contains filtered or unexported fields
}
func NewAttributes ¶
func NewAttributes(attrs ...Attribute) Attributes
NewAttributes creates Attributes object. The order of attrs should be deterministic (e.g. sorted alphabetically by key).
func (Attributes) Get ¶
func (a Attributes) Get(name string) string
func (Attributes) Key ¶
func (a Attributes) Key() AttributesKey
type AttributesKey ¶
type AttributesKey struct {
// contains filtered or unexported fields
}
AttributesKey can be used as a map key.
func NewAttributesKey ¶
func NewAttributesKey(attrs ...Attribute) AttributesKey
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func NewFilter ¶
func NewFilter(fn FilterFunc, source Source) Filter
type FilterFunc ¶
type FilterFunc = genq.FilterFunc[Metric]
func And ¶
func And(operands ...FilterFunc) FilterFunc
func Attr ¶
func Attr(name string, value string) FilterFunc
func False ¶
func False() FilterFunc
func Kind ¶
func Kind(kind MetricKind) FilterFunc
func Name ¶
func Name(name string) FilterFunc
func NonZero ¶
func NonZero() FilterFunc
func Not ¶
func Not(fn FilterFunc) FilterFunc
func Or ¶
func Or(operands ...FilterFunc) FilterFunc
func Prefix ¶
func Prefix(prefix string) FilterFunc
func Scope ¶
func Scope(scope string) FilterFunc
func True ¶
func True() FilterFunc
type Group ¶
type Group[K comparable] struct { // contains filtered or unexported fields }
func (Group[K]) Aggregate ¶
func (a Group[K]) Aggregate(fn AggregationFunc) map[K]Metric
func (Group[K]) AggregateFlat ¶
func (a Group[K]) AggregateFlat(fn AggregationFunc) Metrics
func (Group[K]) Float ¶
func (a Group[K]) Float(fn AggregationFunc) map[K]float64
func (Group[K]) Int ¶
func (a Group[K]) Int(fn AggregationFunc) map[K]int64
type Metric ¶
type Metric struct { Scope string Name string Description string Attributes Attributes Kind MetricKind // Value is a counter or gauge value. // When the metric is histogram, value is set to the sum of all histogram measurements. // This makes histogram measurements easier to work with Value float64 // Count is a number or histogram samples Count uint64 // BucketCounts store how many samples are placed into each bound BucketCounts []uint64 // Bounds is a set of histogram sample bounds. // Bound values are absolute, and this slice should be sorted ASC Bounds []float64 }
Metric is a distinct metric, identified by: - scope - name - unique set of attributes Each metric could be either: 1. Counter / gauge 2. Histogram observation
type MetricAggregationFunc ¶
type MetricAggregationFunc = genq.AggregationFunc[Metric]
func MetricAgg ¶
func MetricAgg(fn AggregationFunc) MetricAggregationFunc
type MetricKey ¶
type MetricKey struct { Scope string Name string AttributesKey AttributesKey }
type MetricKind ¶
type MetricKind int
const ( KindCounter MetricKind = iota + 1 KindGauge KindHistogram )
Click to show internal directories.
Click to hide internal directories.