rrd

package module
v0.0.0-...-cac97a5 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2017 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.

README

rrd

Round Robin Database base on RRDTOOL

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DSTypes = struct {
	Gauge    string
	Counter  string
	Absolute string
	Derive   string
}{
	"GAUGE",
	"COUNTER",
	"ABSOLUTE",
	"DERIVE",
}

DSTypes data source type

View Source
var RRATypes = struct {
	Average string
	Min     string
	Max     string
	Last    string
}{
	"AVERAGE",
	"MIN",
	"MAX",
	"LAST",
}

RRATypes rra type

Functions

func MD5

func MD5(raw string) string

MD5 return md5

func Unix

func Unix(sec int64) time.Time

Unix returns the local Time corresponding to the given Unix time

Types

type Config

type Config struct {
	RRDDir string
	DSS    []DSConfig
}

Config rrd config

type DSConfig

type DSConfig struct {
	Name      string
	Type      string
	Step      uint
	Heartbeat uint
	Max       string
	Min       string
	RRAS      []RRAConfig
}

DSConfig rrd ds config

type Item

type Item struct {
	Value     JSONFloat `json:"value"`
	Timestamp int64     `json:"timestamp"`
}

Item rrd item data

type JSONFloat

type JSONFloat float64

JSONFloat float64 type json by rrd

func (JSONFloat) MarshalJSON

func (v JSONFloat) MarshalJSON() ([]byte, error)

MarshalJSON json marshalJson

type RRAConfig

type RRAConfig struct {
	Type  string
	Xff   float64
	Steps int
	Rows  int
}

RRAConfig rrd rra config

type Tool

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

Tool rrd tool

func NewTool

func NewTool() *Tool

NewTool return new rrd tool

func (*Tool) Cfg

func (t *Tool) Cfg(cfg *Config) *Tool

Cfg config rrd tool

func (*Tool) Fetch

func (t *Tool) Fetch(rraType, ds, pk string, start, end time.Time, step int) (items []*Item, err error)

Fetch fetch data from rrd file

func (*Tool) Write

func (t *Tool) Write(ds, pk string, items []*Item) error

Write write data to rrd file

Directories

Path Synopsis
demo
client command
serve command

Jump to

Keyboard shortcuts

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