Documentation
¶
Index ¶
- Constants
- func ConvertToFloat64(v interface{}) (float64, error)
- func UnixMilli(t time.Time) int64
- type Client
- func (self *Client) Create(md MetricDefinition) (bool, error)
- func (self *Client) Definition(t MetricType, id string) (*MetricDefinition, error)
- func (self *Client) Definitions(t MetricType) ([]*MetricDefinition, error)
- func (self *Client) DeleteTags(t MetricType, id_str string, deleted map[string]string) error
- func (self *Client) PushSingleGaugeMetric(id string, m Datapoint) error
- func (self *Client) SingleGaugeMetric(id string, options map[string]string) ([]*Datapoint, error)
- func (self *Client) Tags(t MetricType, id string) (*map[string]string, error)
- func (self *Client) UpdateTags(t MetricType, id string, tags map[string]string) error
- func (self *Client) Write(metrics []MetricHeader) error
- type Datapoint
- type HawkularClientError
- type HawkularError
- type MetricDefinition
- type MetricHeader
- type MetricType
- type Parameters
Constants ¶
const ( Gauge = iota Availability Counter Generic )
Variables ¶
This section is empty.
Functions ¶
func ConvertToFloat64 ¶
Types ¶
type Client ¶
type Client struct {
Tenant string
// contains filtered or unexported fields
}
func NewHawkularClient ¶
func NewHawkularClient(p Parameters) (*Client, error)
func (*Client) Create ¶
func (self *Client) Create(md MetricDefinition) (bool, error)
Creates a new metric, and returns true if creation succeeded, false if not (metric was already created). err is returned only in case of another error than 'metric already created'
func (*Client) Definition ¶
func (self *Client) Definition(t MetricType, id string) (*MetricDefinition, error)
Return a single definition
func (*Client) Definitions ¶
func (self *Client) Definitions(t MetricType) ([]*MetricDefinition, error)
Fetch metric definitions for one metric type
func (*Client) DeleteTags ¶
Delete given tags from the definition
func (*Client) PushSingleGaugeMetric ¶
Take input of single Metric instance. If Timestamp is not defined, use current time
func (*Client) SingleGaugeMetric ¶
Read single Gauge metric's datapoints. TODO: Remove and replace with better Read properties? Perhaps with iterators?
func (*Client) UpdateTags ¶
Replace metric definition tags TODO: Should this be "ReplaceTags" etc?
func (*Client) Write ¶
func (self *Client) Write(metrics []MetricHeader) error
Write using mixedmultimetrics For now supports only single metricType per request
type Datapoint ¶
type Datapoint struct {
Timestamp int64 `json:"timestamp"`
Value interface{} `json:"value"`
Tags map[string]string `json:"tags,omitempty"`
}
Value should be convertible to float64 for numeric values Timestamp is milliseconds since epoch
type HawkularClientError ¶
type HawkularClientError struct {
Code int
// contains filtered or unexported fields
}
func (*HawkularClientError) Error ¶
func (self *HawkularClientError) Error() string
type HawkularError ¶
type HawkularError struct {
ErrorMsg string `json:"errorMsg"`
}
type MetricDefinition ¶
type MetricDefinition struct {
Type MetricType `json:"-"`
Id string `json:"id"`
Tags map[string]string `json:"tags,omitempty"`
RetentionTime int `json:"dataRetention,omitempty"`
}
type MetricHeader ¶
type MetricHeader struct {
Type MetricType `json:"-"`
Id string `json:"id"`
Data []Datapoint `json:"data"`
}
type MetricType ¶
type MetricType int
MetricType restrictions
func (MetricType) String ¶
func (self MetricType) String() string