mwhisper

package
v0.0.0-...-a5cab06 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2018 License: BSD-2-Clause Imports: 8 Imported by: 1

Documentation

Overview

Package carbonmem is a memory-backed carbon store

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TrigramCutoff

func TrigramCutoff(cutoff int) func(*Whisper) error

TrigramCutoff sets percentage above which trigrams are removed from the search index

Types

type Count

type Count uint32

Count is the number of times a metric has been seen in a time period

type Fetched

type Fetched struct {
	From   int32
	Until  int32
	Step   int32
	Values []float64
}

Fetched is a response to a fetch request

type Glob

type Glob struct {
	Metric string
	IsLeaf bool
}

Glob is a response to a find query

type MetricID

type MetricID uint32

MetricID identifies a metric in the memory store

type Whisper

type Whisper struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Whisper is an in-memory whisper-like store

func NewWhisper

func NewWhisper(t0 int32, ecap, cap int, options ...func(*Whisper) error) *Whisper

NewWhisper returns a new Whisper store

func (*Whisper) Fetch

func (w *Whisper) Fetch(metric string, from int32, until int32) *Fetched

Fetch retrieves a metric between two given epochs

func (*Whisper) Find

func (w *Whisper) Find(query string) []Glob

Find expands a glob query across the metrics in the store

func (*Whisper) Len

func (w *Whisper) Len() int

Len returns how many metrics are in the store

func (*Whisper) Set

func (w *Whisper) Set(t int32, metric string, val uint64)

Set adds a metric at a given epoch with a given value

func (*Whisper) TopK

func (w *Whisper) TopK(prefix string, seconds int32) []Glob

TopK returns the top 100 metrics (by count over the preceding time period) matching the query prefix

Jump to

Keyboard shortcuts

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