rrd

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Printer

type Printer interface {
	Print(w io.Writer) error
}

type RRD

type RRD interface {
	// Slot returns the current window (slot) to store values.
	Slot() (Slot, error)
	// Counters, return all stored counters since the given time (since) until now.
	Counters(since time.Time) (map[string]float64, error)
	// Last returns the last reported value for a metric given the metric
	// name
	Last(key string) (value float64, ok bool, err error)

	// Close the db
	Close() error
}

RRD is a round robin database of fixed size which is specified on creation RRD stores `counter` values. Which means values that can only go UP. then it's easy to compute the increase of this counter over a given window The database only keep history based on retention.

func NewRRDBolt

func NewRRDBolt(path string, window time.Duration, retention time.Duration) (RRD, error)

NewRRDBolt creates a new rrd database that uses bolt as a storage. if window or retention are 0 the function will panic. If retnetion is smaller then window the function will panic. retention and window must be multiple of 1 minute.

type Slot

type Slot interface {
	// Counter sets (or overrides) the current stored value for this key,
	// with value
	Counter(key string, value float64) error
	// Key return the key of the slot which is the window timestamp
	Key() uint64
}

Jump to

Keyboard shortcuts

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