influx

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CPU_COEFF = 1e12
)
View Source
const (
	MEM_COEFF = 1e12
)

Variables

View Source
var (
	ErrEmptyResult            = errors.New("empty result from InfluxDB")
	ErrNoSeriesFound          = errors.New("no series found")
	ErrNoValuesFound          = errors.New("no values found")
	ErrInvalidDataPointFormat = errors.New("invalid data poin format")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Database string
	Addr     string
	Username string
	Password string
	NumCPU   uint64
	Memory   uint64
}

type Influx

type Influx struct {
	influx.Client
	// contains filtered or unexported fields
}

func NewInflux

func NewInflux(config Config) (*Influx, error)

func (*Influx) CPUCurrent

func (flux *Influx) CPUCurrent() (float64, error)

func (*Influx) CPUFactor

func (flux *Influx) CPUFactor() float64

func (*Influx) CPUHistory

func (flux *Influx) CPUHistory(from, to time.Time, step time.Duration) (vector.Vec, error)

func (*Influx) MemoryCurrent

func (flux *Influx) MemoryCurrent() (float64, error)

func (*Influx) MemoryFactor

func (flux *Influx) MemoryFactor() float64

func (*Influx) MemoryHistory

func (flux *Influx) MemoryHistory(from, to time.Time, step time.Duration) (vector.Vec, error)

func (*Influx) Query

func (flux *Influx) Query(cmd string, args ...interface{}) ([]influx.Result, error)

func (*Influx) SelectFrom

func (flux *Influx) SelectFrom(from string, columns ...string) influx.Query

func (*Influx) SelectFromWithLimit

func (flux *Influx) SelectFromWithLimit(from string, limit uint, columns ...string) influx.Query

type Precision

type Precision string
const (
	FullPrecision Precision = ""
)

type SeriesConfig

type SeriesConfig struct {
	Step      *time.Duration
	Precision *Precision
}

func DefaultSeries

func DefaultSeries() SeriesConfig

func MergeSeriesConfigs

func MergeSeriesConfigs(configs []SeriesConfig) SeriesConfig

func (SeriesConfig) Merge

func (config SeriesConfig) Merge(another SeriesConfig) SeriesConfig

Jump to

Keyboard shortcuts

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