Documentation ¶
Index ¶
- func ParseByte(dataItem MetricDataFormat, data []byte) error
- type CeilometerMetric
- func (c *CeilometerMetric) GetInterval() float64
- func (c *CeilometerMetric) GetItemKey() string
- func (c CeilometerMetric) GetKey() string
- func (c *CeilometerMetric) GetLabels() map[string]string
- func (c *CeilometerMetric) GetMetricDesc(index int) string
- func (c *CeilometerMetric) GetMetricName(index int) string
- func (c *CeilometerMetric) GetName() string
- func (c *CeilometerMetric) GetValues() []float64
- func (c *CeilometerMetric) ISNew() bool
- func (c *CeilometerMetric) ParseInputByte(data []byte) error
- func (c *CeilometerMetric) ParseInputJSON(data string) ([]MetricDataFormat, error)
- func (c *CeilometerMetric) SetData(data MetricDataFormat)
- func (c *CeilometerMetric) SetNew(new bool)
- type CollectdMetric
- func (c *CollectdMetric) DSName(index int) string
- func (c *CollectdMetric) GetInterval() float64
- func (c CollectdMetric) GetItemKey() string
- func (c CollectdMetric) GetKey() string
- func (c CollectdMetric) GetLabels() map[string]string
- func (c CollectdMetric) GetMetricDesc(index int) string
- func (c CollectdMetric) GetMetricName(index int) string
- func (c CollectdMetric) GetName() string
- func (c CollectdMetric) GetValues() []float64
- func (c *CollectdMetric) ISNew() bool
- func (c *CollectdMetric) ParseInputByte(data []byte) error
- func (c *CollectdMetric) ParseInputJSON(jsonString string) ([]MetricDataFormat, error)
- func (c *CollectdMetric) SetData(data MetricDataFormat)
- func (c *CollectdMetric) SetNew(new bool)
- type MetricDataFormat
- type WithDataSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseByte ¶
func ParseByte(dataItem MetricDataFormat, data []byte) error
ParseByte parse incoming data
Types ¶
type CeilometerMetric ¶
type CeilometerMetric struct { WithDataSource Publisher string `json:"publisher_id"` Payload map[string]interface{} `json:"payload"` // analogy to collectd metric Plugin string PluginInstance string Type string TypeInstance string Values []float64 // contains filtered or unexported fields }
CeilometerMetric struct represents metric data formated and sent by Ceilometer
func (*CeilometerMetric) GetInterval ¶
func (c *CeilometerMetric) GetInterval() float64
GetInterval returns hardcoded defaultCeilometerInterval, because Ceilometer metricDesc does not contain interval information (are not periodically sent at all) and any reasonable interval might be needed for expiry setting for Prometheus TODO: Make this configurable
func (*CeilometerMetric) GetItemKey ¶
func (c *CeilometerMetric) GetItemKey() string
GetItemKey returns name cache key analogically to CollectdMetric implementation
func (*CeilometerMetric) GetLabels ¶
func (c *CeilometerMetric) GetLabels() map[string]string
GetLabels ...
func (*CeilometerMetric) GetMetricDesc ¶
func (c *CeilometerMetric) GetMetricDesc(index int) string
GetMetricDesc ...
func (*CeilometerMetric) GetMetricName ¶
func (c *CeilometerMetric) GetMetricName(index int) string
GetMetricName ...
func (*CeilometerMetric) GetName ¶
func (c *CeilometerMetric) GetName() string
GetName returns name of Ceilometer "plugin" (analogically to CollectdMetric implementation)
func (*CeilometerMetric) GetValues ¶
func (c *CeilometerMetric) GetValues() []float64
GetValues returns Values. The purpose of this method is to be able to get metric Values from the interface object itself
func (*CeilometerMetric) ParseInputByte ¶
func (c *CeilometerMetric) ParseInputByte(data []byte) error
ParseInputByte is not really used. It is here just to implement MetricDataFormat TODO: Remove this method from here and also CollectdMetric
func (*CeilometerMetric) ParseInputJSON ¶
func (c *CeilometerMetric) ParseInputJSON(data string) ([]MetricDataFormat, error)
ParseInputJSON ...
func (*CeilometerMetric) SetData ¶
func (c *CeilometerMetric) SetData(data MetricDataFormat)
SetData generates naming and value data analogicaly to CollectdMetric from counter data and resource_id
type CollectdMetric ¶
type CollectdMetric struct { WithDataSource Values []float64 `json:"values"` Dstypes []string `json:"dstypes"` Dsnames []string `json:"dsnames"` Time cdtime.Time `json:"time"` Interval float64 `json:"interval"` Host string `json:"host"` Plugin string `json:"plugin"` PluginInstance string `json:"plugin_instance"` Type string `json:"type"` TypeInstance string `json:"type_instance"` // contains filtered or unexported fields }
CollectdMetric struct represents metric data formated and sent by collectd
func (*CollectdMetric) DSName ¶
func (c *CollectdMetric) DSName(index int) string
DSName newName converts one data source of a value list to a string representation.
func (CollectdMetric) GetLabels ¶
func (c CollectdMetric) GetLabels() map[string]string
GetLabels ...
func (CollectdMetric) GetMetricDesc ¶
func (c CollectdMetric) GetMetricDesc(index int) string
GetMetricDesc newDesc converts one data source of a value list to a Prometheus description.
func (CollectdMetric) GetMetricName ¶
func (c CollectdMetric) GetMetricName(index int) string
GetMetricName ...
func (CollectdMetric) GetName ¶
func (c CollectdMetric) GetName() string
GetName implement interface
func (CollectdMetric) GetValues ¶
func (c CollectdMetric) GetValues() []float64
GetValues returns Values. The purpose of this method is to be able to get metric Values from the interface object itself
func (*CollectdMetric) ParseInputByte ¶
func (c *CollectdMetric) ParseInputByte(data []byte) error
ParseInputByte ... TODO(mmagr): probably unify interface with ParseInputJSON
func (*CollectdMetric) ParseInputJSON ¶
func (c *CollectdMetric) ParseInputJSON(jsonString string) ([]MetricDataFormat, error)
ParseInputJSON ...
func (*CollectdMetric) SetData ¶
func (c *CollectdMetric) SetData(data MetricDataFormat)
SetData ...
type MetricDataFormat ¶
type MetricDataFormat interface { GetName() string SetData(data MetricDataFormat) ParseInputJSON(json string) ([]MetricDataFormat, error) GetKey() string GetItemKey() string ParseInputByte(data []byte) error GetInterval() float64 SetNew(new bool) ISNew() bool GetValues() []float64 GetDataSourceName() string }
MetricDataFormat ...
func NewFromDataSource ¶
func NewFromDataSource(source saconfig.DataSource) MetricDataFormat
NewFromDataSource creates empty DataType according to given DataSource
func NewFromDataSourceName ¶
func NewFromDataSourceName(source string) MetricDataFormat
NewFromDataSourceName creates empty DataType according to given name of DataSource
type WithDataSource ¶
type WithDataSource struct {
DataSource saconfig.DataSource
}
WithDataSource is composition struct for adding DataSource parameter
func (WithDataSource) GetDataSourceName ¶
func (ds WithDataSource) GetDataSourceName() string
GetDataSourceName returns string representation of DataSource