measures

package
v0.0.0-...-f5426d5 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchOpts

type BatchOpts struct {
	Data map[string]PushOpts `json:""`
}

func (BatchOpts) ToMetricBatchMap

func (opts BatchOpts) ToMetricBatchMap() (map[string]interface{}, error)

type BatchOptsBuilder

type BatchOptsBuilder interface {
	ToMetricBatchMap() (string, error)
}

type BatchResult

type BatchResult struct {
	gophercloud.Result
}

func Batch

func Batch(client *gophercloud.ServiceClient, opts BatchOpts) (r BatchResult)

It is also possible to batch measures sending, i.e. send several measures for different metrics in a simple call

type MeasureResult

type MeasureResult struct {
	gophercloud.Result
}

func MeasureRead

func MeasureRead(client *gophercloud.ServiceClient, metricID string, opts MeasuresOptsBuilder) MeasureResult

func (MeasureResult) Extract

func (r MeasureResult) Extract() ([]interface{}, error)

type MeasuresOpts

type MeasuresOpts struct {
	//Depending on the driver, there may be some lag after pushing measures
	//before they are processed and queryable. To ensure your query returns
	//all aggregates that have been pushed and processed, you can force any
	//unprocessed measures to be handled:
	Refresh bool `q:"refresh"`

	//It is possible to filter the aggregates over a time range by specifying
	//the start and/or stop parameters to the query with timestamp. The timestamp
	//format can be either a floating number (UNIX epoch) or an ISO8601 formated timestamp:
	Start string `q:"start"`

	Stop string `q:"stop"`

	//By default, the aggregated values that are returned use the mean aggregation method.
	//It is possible to request for any other method defined by the policy by specifying the
	//aggregation query parameter:
	Aggregation string `q:"aggregation"`

	//It’s possible to provide the granularity argument to specify the granularity to retrieve,
	//rather than all the granularities available:
	Granularity int `q:"granularity"`

	//In addition to granularities defined by the archive policy, aggregates can be resampled to a new granularity.
	Resample int `q:"resample"`
}

func (MeasuresOpts) ToMetricMeasuresQuery

func (opts MeasuresOpts) ToMetricMeasuresQuery() (string, error)

type MeasuresOptsBuilder

type MeasuresOptsBuilder interface {
	ToMetricMeasuresQuery() (string, error)
}

type PushData

type PushData struct {
	TimeStamp string  `json:"timestamp" required:"true"`
	Value     float32 `json:"value" required:"true"`
}

type PushOpts

type PushOpts struct {
	Data []PushData `json:""`
}

func (PushOpts) ToMetricPushMap

func (opts PushOpts) ToMetricPushMap() (map[string]interface{}, error)

type PushOptsBuilder

type PushOptsBuilder interface {
	ToMetricPushMap() (string, error)
}

type PushResult

type PushResult struct {
	gophercloud.Result
}

func Push

func Push(client *gophercloud.ServiceClient, metricID string, opts PushOpts) (r PushResult)

It is possible to send measures to the metric

Jump to

Keyboard shortcuts

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