Documentation ¶
Index ¶
- Constants
- func CreateMetric(key string, data *Matrix) error
- func DefaultExportOptions() *node.Node
- type Instance
- func (i *Instance) ClearLabels()
- func (i *Instance) Clone(isExportable bool, labels ...string) *Instance
- func (i *Instance) CompareDiffs(prev *Instance, compareKeys []string) (map[string]string, map[string]string)
- func (i *Instance) Copy(labels ...string) map[string]string
- func (i *Instance) GetIndex() int
- func (i *Instance) GetLabel(key string) string
- func (i *Instance) GetLabels() map[string]string
- func (i *Instance) IsExportable() bool
- func (i *Instance) IsPartial() bool
- func (i *Instance) SetExportable(b bool)
- func (i *Instance) SetLabel(key, value string)
- func (i *Instance) SetLabels(labels map[string]string)
- func (i *Instance) SetPartial(b bool)
- type Matrix
- func (m *Matrix) Clone(with With) *Matrix
- func (m *Matrix) Delta(metricKey string, prevMat *Matrix, logger *slog.Logger) (int, error)
- func (m *Matrix) DisplayMetric(name string) *Metric
- func (m *Matrix) DisplayMetricKey(name string) string
- func (m *Matrix) Divide(metricKey string, baseKey string) (int, error)
- func (m *Matrix) DivideWithThreshold(metricKey string, baseKey string, threshold int, curRawMat *Matrix, ...) (int, error)
- func (m *Matrix) GetExportOptions() *node.Node
- func (m *Matrix) GetGlobalLabels() map[string]string
- func (m *Matrix) GetInstance(key string) *Instance
- func (m *Matrix) GetInstanceKeys() []string
- func (m *Matrix) GetInstances() map[string]*Instance
- func (m *Matrix) GetInstancesBySuffix(subKey string) []*Instance
- func (m *Matrix) GetMetric(key string) *Metric
- func (m *Matrix) GetMetrics() map[string]*Metric
- func (m *Matrix) InstanceWiseAdditionUint64(toInstance, fromInstance *Instance, fromData *Matrix)
- func (m *Matrix) IsExportable() bool
- func (m *Matrix) LazyAddValueInt64(key, i string, v int64) error
- func (m *Matrix) LazyAddValueUint64(key, i string, v uint64) error
- func (m *Matrix) LazyGetValueFloat64(key, i string) (float64, bool)
- func (m *Matrix) LazyGetValueInt64(key, i string) (int64, bool)
- func (m *Matrix) LazySetValueFloat64(mkey, ikey string, v float64) error
- func (m *Matrix) LazySetValueInt64(mkey, ikey string, v int64) error
- func (m *Matrix) LazySetValueUint64(mkey, ikey string, v uint64) error
- func (m *Matrix) LazySetValueUint8(mkey, ikey string, v uint8) error
- func (m *Matrix) LazyValueFloat64(key, i string) float64
- func (m *Matrix) LazyValueInt64(key, i string) int64
- func (m *Matrix) MultiplyByScalar(metricKey string, s uint) (int, error)
- func (m *Matrix) NewInstance(key string) (*Instance, error)
- func (m *Matrix) NewMetricFloat64(key string, display ...string) (*Metric, error)
- func (m *Matrix) NewMetricInt64(key string, display ...string) (*Metric, error)
- func (m *Matrix) NewMetricType(key string, dataType string, display ...string) (*Metric, error)
- func (m *Matrix) NewMetricUint64(key string, display ...string) (*Metric, error)
- func (m *Matrix) NewMetricUint8(key string, display ...string) (*Metric, error)
- func (m *Matrix) Print()
- func (m *Matrix) PurgeInstances()
- func (m *Matrix) PurgeMetrics()
- func (m *Matrix) RemoveExceptMetric(key string)
- func (m *Matrix) RemoveInstance(key string)
- func (m *Matrix) RemoveMetric(key string)
- func (m *Matrix) Reset()
- func (m *Matrix) ResetInstance(key string)
- func (m *Matrix) SetExportOptions(e *node.Node)
- func (m *Matrix) SetExportable(b bool)
- func (m *Matrix) SetGlobalLabel(label, value string)
- func (m *Matrix) SetGlobalLabels(allLabels map[string]string)
- func (m *Matrix) Skip(metricKey string) int
- type Metric
- func (m *Metric) AddValueFloat64(i *Instance, n float64) error
- func (m *Metric) AddValueInt64(i *Instance, n int64) error
- func (m *Metric) AddValueString(i *Instance, v string) error
- func (m *Metric) AddValueUint64(i *Instance, n uint64) error
- func (m *Metric) AddValueUint8(i *Instance, n uint8) error
- func (m *Metric) Append()
- func (m *Metric) Buckets() *[]string
- func (m *Metric) Clone(deep bool) *Metric
- func (m *Metric) GetComment() string
- func (m *Metric) GetLabel(key string) string
- func (m *Metric) GetLabels() map[string]string
- func (m *Metric) GetName() string
- func (m *Metric) GetProperty() string
- func (m *Metric) GetRecords() []bool
- func (m *Metric) GetType() string
- func (m *Metric) GetValueBytes(i *Instance) ([]byte, bool)
- func (m *Metric) GetValueFloat64(i *Instance) (float64, bool)
- func (m *Metric) GetValueInt(i *Instance) (int, bool)
- func (m *Metric) GetValueInt64(i *Instance) (int64, bool)
- func (m *Metric) GetValueString(i *Instance) (string, bool)
- func (m *Metric) GetValueUint64(i *Instance) (uint64, bool)
- func (m *Metric) GetValueUint8(i *Instance) (uint8, bool)
- func (m *Metric) GetValues() []float64
- func (m *Metric) HasLabels() bool
- func (m *Metric) IsArray() bool
- func (m *Metric) IsExportable() bool
- func (m *Metric) IsHistogram() bool
- func (m *Metric) Print()
- func (m *Metric) Remove(index int)
- func (m *Metric) Reset(size int)
- func (m *Metric) SetArray(c bool)
- func (m *Metric) SetBuckets(buckets *[]string)
- func (m *Metric) SetComment(c string)
- func (m *Metric) SetExportable(b bool)
- func (m *Metric) SetHistogram(b bool)
- func (m *Metric) SetLabel(key, value string)
- func (m *Metric) SetLabels(labels map[string]string)
- func (m *Metric) SetProperty(p string)
- func (m *Metric) SetValueBytes(i *Instance, v []byte) error
- func (m *Metric) SetValueFloat64(i *Instance, v float64) error
- func (m *Metric) SetValueInt64(i *Instance, v int64) error
- func (m *Metric) SetValueNAN(i *Instance)
- func (m *Metric) SetValueString(i *Instance, v string) error
- func (m *Metric) SetValueUint64(i *Instance, v uint64) error
- func (m *Metric) SetValueUint8(i *Instance, v uint8) error
- type With
Constants ¶
View Source
const ( ErrInvalidDtype = matrixError("invalid data type") ErrInvalidMetricKey = matrixError("invalid metric key") ErrInvalidInstanceKey = matrixError("invalid instance key") ErrDuplicateMetricKey = matrixError("duplicate metric key") ErrDuplicateInstanceKey = matrixError("duplicate instance key") ErrUnequalVectors = matrixError("unequal vectors") )
Variables ¶
This section is empty.
Functions ¶
func CreateMetric ¶
func DefaultExportOptions ¶
Types ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
func NewInstance ¶
func (*Instance) ClearLabels ¶
func (i *Instance) ClearLabels()
func (*Instance) CompareDiffs ¶
func (i *Instance) CompareDiffs(prev *Instance, compareKeys []string) (map[string]string, map[string]string)
CompareDiffs iterates through each key in compareKeys, checking if the receiver and prev have the same value for that key. When the values are different, return a new Map with the current and previous value
func (*Instance) IsExportable ¶
func (*Instance) SetExportable ¶
func (*Instance) SetPartial ¶
type Matrix ¶
type Matrix struct { UUID string Object string Identifier string // contains filtered or unexported fields }
func (*Matrix) DisplayMetric ¶
func (*Matrix) DisplayMetricKey ¶
func (*Matrix) DivideWithThreshold ¶
func (m *Matrix) DivideWithThreshold(metricKey string, baseKey string, threshold int, curRawMat *Matrix, prevRawMat *Matrix, timestampMetricName string, logger *slog.Logger) (int, error)
DivideWithThreshold applicable for latency counters
func (*Matrix) GetExportOptions ¶
func (*Matrix) GetGlobalLabels ¶
func (*Matrix) GetInstance ¶
func (*Matrix) GetInstanceKeys ¶
func (*Matrix) GetInstances ¶
func (*Matrix) GetInstancesBySuffix ¶
func (*Matrix) GetMetrics ¶
func (*Matrix) InstanceWiseAdditionUint64 ¶
func (*Matrix) IsExportable ¶
IsExportable indicates whether this matrix is meant to be exported or not (some data is only collected to be aggregated by plugins)
func (*Matrix) LazyAddValueUint64 ¶
func (*Matrix) LazyGetValueFloat64 ¶
func (*Matrix) LazySetValueFloat64 ¶
func (*Matrix) LazySetValueInt64 ¶
func (*Matrix) LazySetValueUint64 ¶
func (*Matrix) LazySetValueUint8 ¶
func (*Matrix) LazyValueFloat64 ¶
func (*Matrix) LazyValueInt64 ¶
func (*Matrix) MultiplyByScalar ¶
func (*Matrix) NewMetricFloat64 ¶
func (*Matrix) NewMetricInt64 ¶
func (*Matrix) NewMetricType ¶
func (*Matrix) NewMetricUint64 ¶
func (*Matrix) NewMetricUint8 ¶
func (*Matrix) PurgeInstances ¶
func (m *Matrix) PurgeInstances()
func (*Matrix) PurgeMetrics ¶
func (m *Matrix) PurgeMetrics()
func (*Matrix) RemoveExceptMetric ¶
func (*Matrix) RemoveInstance ¶
func (*Matrix) RemoveMetric ¶
func (*Matrix) ResetInstance ¶
func (*Matrix) SetExportOptions ¶
func (*Matrix) SetExportable ¶
func (*Matrix) SetGlobalLabel ¶
func (*Matrix) SetGlobalLabels ¶
SetGlobalLabels copies allLabels to globalLabels when the label does not exist in globalLabels
type Metric ¶
type Metric struct {
// contains filtered or unexported fields
}
func (*Metric) GetComment ¶
func (*Metric) GetProperty ¶
func (*Metric) GetRecords ¶
func (*Metric) IsExportable ¶
func (*Metric) IsHistogram ¶
func (*Metric) SetBuckets ¶
func (*Metric) SetComment ¶
func (*Metric) SetExportable ¶
func (*Metric) SetHistogram ¶
func (*Metric) SetProperty ¶
func (*Metric) SetValueNAN ¶
Click to show internal directories.
Click to hide internal directories.