...

Package metrics

import "bitbucket.org/twicedb/twicedb-go/client/metrics"
Overview
Index

Overview ▾

Package metrics provides functions for storing and retrieving client metrics.

type ClientMetrics

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

func NewClientMetrics

func NewClientMetrics() *ClientMetrics

func (*ClientMetrics) AddLatency

func (cm *ClientMetrics) AddLatency(rk RequestKind, l int64) error

func (*ClientMetrics) IncrementReachedReadQueueCapacity

func (cm *ClientMetrics) IncrementReachedReadQueueCapacity()

func (*ClientMetrics) IncrementReachedWriteQueueCapacity

func (cm *ClientMetrics) IncrementReachedWriteQueueCapacity()

func (*ClientMetrics) PercentileMap

func (cm *ClientMetrics) PercentileMap(rk RequestKind) (*PercentileMapWithCount, error)

func (*ClientMetrics) ReachedReadQueueCapacity

func (cm *ClientMetrics) ReachedReadQueueCapacity() int64

func (*ClientMetrics) ReachedWriteQueueCapacity

func (cm *ClientMetrics) ReachedWriteQueueCapacity() int64

type PercentileMapWithCount

type PercentileMapWithCount struct {
    PercentileMap *map[float64]float64
    Count         int64
}

type RequestKind

type RequestKind int8
const (
    ReadEvent RequestKind = iota
    ReadFromQueue
    ReadObjectsAtVt
    ReadObjectsAtTt
    ReadObjectsByEvent
    ReadObjectsByFqn
    ReadObjectsByIndexes
    ReadPoint
    Write
    WriteFromQueue
    CountByIndexes // Aggregations
    MaxByIndexes
    MeanByIndexes
    MedianByIndexes
    MinByIndexes
    PercentileByIndexes
    StdevByIndexes
    SumByIndexes
    VarByIndexes
    ListLockedFqns // Lock / Unlock Fqns
    LockFqns
    UnlockFqns
    Entitle // Entitlements
)

func RequestKinds

func RequestKinds() []RequestKind

func (RequestKind) String

func (i RequestKind) String() string