mss

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

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

Go to latest
Published: Aug 14, 2015 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMeasurementAlreadyFinished = errors.New("measurement has already finished")
)

Functions

func Record

func Record(m *Measurement)

func Shutdown

func Shutdown()

func StartAgent

func StartAgent(d Driver, maxBatchSize uint, maxElapsedTime time.Duration)

StartAgent starts running agent with the given configuration

Types

type Config

type Config struct {
}

Config defines a struct containing all the available configuration for this package.

type Data

type Data map[string]interface{}

type Driver

type Driver interface {
	Persist([]*Measurement) error
}

type InfluxDBConfig

type InfluxDBConfig struct {
	URL      string
	Username string
	Password string
	Database string
}

InfluxDBConfig specifies the configuration for connecting to a InfluxDB instance that is a little bit more friendly to instantiate from.

type InfluxDBDriver

type InfluxDBDriver struct {
	Client   *influx.Client
	Database string
	// contains filtered or unexported fields
}

InfluxDBDriver implements the Driver interface that knows how to persist data points into InfluxDB.

func NewInfluxDBDriver

func NewInfluxDBDriver(cfg *InfluxDBConfig) (*InfluxDBDriver, error)

NewInfluxDBDriver initializes an InfluxDBDriver instance with the provided configuration.

func (*InfluxDBDriver) CreateInfluxDB

func (d *InfluxDBDriver) CreateInfluxDB() error

creates the InfluxDB database

func (*InfluxDBDriver) DropInfluxDB

func (d *InfluxDBDriver) DropInfluxDB() error

drops the influx database

func (*InfluxDBDriver) Persist

func (d *InfluxDBDriver) Persist(batch []*Measurement) error

Persist implements the Driver interface, persisting the data points to InfluxDB.

type Measurement

type Measurement struct {
	Info ctxinfo.Info

	Name       string
	StartedAt  time.Time
	FinishedAt time.Time
	Data       Data
}

func NewMeasurement

func NewMeasurement(ctx context.Context, name string, data Data) *Measurement

func (Measurement) Duration

func (m Measurement) Duration() time.Duration

func (*Measurement) Finish

func (m *Measurement) Finish() error

func (*Measurement) SetData

func (m *Measurement) SetData(d map[string]interface{})

Jump to

Keyboard shortcuts

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