stats

package
v0.0.0-...-0ce2e87 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace     = "dkv"
	Ops           = "ops"
	Put           = "put"
	MultiPut      = "mput"
	Get           = "get"
	MultiGet      = "mget"
	Delete        = "del"
	GetSnapShot   = "getSnapShot"
	PutSnapShot   = "putSnapShot"
	Iterate       = "iter"
	CompareAndSet = "cas"
	LoadChange    = "loadChange"
	SaveChange    = "saveChange"
)

Variables

This section is empty.

Functions

func MeasureLatency

func MeasureLatency(observer prometheus.Observer, startTime time.Time)

func MergeMapFloat64

func MergeMapFloat64(m1, m2 map[string]float64) map[string]float64

func MergeMapPercentile

func MergeMapPercentile(m1, m2 map[string]*Percentile, count float64) map[string]*Percentile

func MergeMapUint64

func MergeMapUint64(m1, m2 map[string]uint64) map[string]uint64

func NewPromethousNoopRegistry

func NewPromethousNoopRegistry() prometheus.Registerer

func NewPromethousRegistry

func NewPromethousRegistry() prometheus.Registerer

Types

type Client

type Client interface {
	io.Closer
	Incr(string, int64)
	Gauge(string, int64)
	GaugeDelta(string, int64)
	Timing(string, time.Time)
}

Client exposes all the behavior for capturing and and sending various measurements to a metrics sink.

func NewNoOpClient

func NewNoOpClient() Client

NewNoOpClient creates a metrics client that does not send any measurements.

func NewStatsDClient

func NewStatsDClient(statsdAddr, metricPrfx string, defTags ...Tag) Client

NewStatsDClient creates a metrics client that sends various measurements to StatsD client.

type DKVMetrics

type DKVMetrics struct {
	TimeStamp            int64                  `json:"ts"`
	StoreLatency         map[string]*Percentile `json:"storage_latency"`
	NexusLatency         map[string]*Percentile `json:"nexus_latency"`
	DKVLatency           map[string]*Percentile `json:"dkv_latency"`
	StorageOpsCount      map[string]uint64      `json:"storage_ops_count"`
	StorageOpsErrorCount map[string]float64     `json:"storage_ops_error_count"`
	NexusOpsCount        map[string]uint64      `json:"nexus_ops_count"`
	DKVReqCount          map[string]uint64      `json:"dkv_req_count"`
	Count                float64                `json:"count"`
}

func GetMetrics

func GetMetrics() (*DKVMetrics, error)

func NewDKVMetric

func NewDKVMetric() *DKVMetrics

func (*DKVMetrics) Merge

func (dm *DKVMetrics) Merge(dm1 DKVMetrics)

type Percentile

type Percentile struct {
	P50 jFloat64 `json:"p50"`
	P90 jFloat64 `json:"p90"`
	P99 jFloat64 `json:"p99"`
}

func NewPercentile

func NewPercentile(quantile []*dto.Quantile) *Percentile

type StatStreamer

type StatStreamer struct {
	// contains filtered or unexported fields
}

func NewStatStreamer

func NewStatStreamer() *StatStreamer

func (*StatStreamer) DeRegister

func (sp *StatStreamer) DeRegister(id int64)

func (*StatStreamer) Register

func (sp *StatStreamer) Register(outputChannel chan DKVMetrics) int64

func (*StatStreamer) Run

func (sp *StatStreamer) Run()

type Tag

type Tag struct {
	// contains filtered or unexported fields
}

Tag represents the key value pair that is sent along with every measurement to a metrics sink.

func NewTag

func NewTag(key, val string) Tag

NewTag creates an instance of the Tag type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL