Documentation ¶
Index ¶
- Constants
- func ConvertToFloat64(v interface{}) (float64, error)
- func UnixMilli(t time.Time) int64
- type Client
- func (self *Client) Create(md MetricDefinition, o ...Modifier) (bool, error)
- func (self *Client) Definition(t MetricType, id string) (*MetricDefinition, error)
- func (self *Client) Definitions(o ...Modifier) ([]*MetricDefinition, error)
- func (self *Client) DeleteTags(t MetricType, id string, tags map[string]string, o ...Modifier) error
- func (self *Client) ReadMetric(t MetricType, id string, o ...Modifier) ([]*Datapoint, error)
- func (self *Client) Send(o ...Modifier) (*http.Response, error)
- func (self *Client) SingleGaugeMetric(id string, options map[string]string) ([]*Datapoint, error)
- func (self *Client) Tags(t MetricType, id string, o ...Modifier) (map[string]string, error)
- func (self *Client) UpdateTags(t MetricType, id string, tags map[string]string, o ...Modifier) error
- func (self *Client) Url(method string, e ...Endpoint) Modifier
- func (self *Client) Write(metrics []MetricHeader, o ...Modifier) error
- type Datapoint
- type Endpoint
- type Filter
- type HawkularClient
- type HawkularClientError
- type HawkularError
- type MetricDefinition
- type MetricHeader
- type MetricType
- type Modifier
- type Parameters
- type SortKey
Constants ¶
View Source
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, o ...Modifier) (bool, error)
Create new Definition
func (*Client) Definition ¶
func (self *Client) Definition(t MetricType, id string) (*MetricDefinition, error)
Return a single definition
func (*Client) Definitions ¶
func (self *Client) Definitions(o ...Modifier) ([]*MetricDefinition, error)
Fetch definitions
func (*Client) DeleteTags ¶
func (self *Client) DeleteTags(t MetricType, id string, tags map[string]string, o ...Modifier) error
Delete given tags from the definition
func (*Client) ReadMetric ¶ added in v0.4.0
Read data from the server
func (*Client) SingleGaugeMetric ¶
Read single Gauge metric's datapoints. TODO: Remove and replace with better Read properties? Perhaps with iterators?
func (*Client) UpdateTags ¶
func (self *Client) UpdateTags(t MetricType, id string, tags map[string]string, o ...Modifier) error
Update tags
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 Endpoint ¶ added in v0.4.0
func DataEndpoint ¶ added in v0.4.0
func DataEndpoint() Endpoint
func SingleMetricEndpoint ¶ added in v0.4.0
func TagEndpoint ¶ added in v0.4.0
func TagEndpoint() Endpoint
func TagsEndpoint ¶ added in v0.4.0
func TypeEndpoint ¶ added in v0.4.0
func TypeEndpoint(t MetricType) Endpoint
type Filter ¶ added in v0.4.0
func BucketsFilter ¶ added in v0.4.0
func EndTimeFilter ¶ added in v0.4.0
func StartTimeFilter ¶ added in v0.4.0
func TagsFilter ¶ added in v0.4.0
func TypeFilter ¶ added in v0.4.0
func TypeFilter(t MetricType) Filter
type HawkularClient ¶ added in v0.4.0
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 MetricHeader ¶
type MetricHeader struct { Tenant string `json:"-"` Type MetricType `json:"-"` Id string `json:"id"` Data []Datapoint `json:"data"` }
type MetricType ¶
type MetricType int
MetricType restrictions
func (MetricType) MarshalJSON ¶ added in v0.4.0
func (self MetricType) MarshalJSON() ([]byte, error)
func (MetricType) String ¶
func (self MetricType) String() string
func (*MetricType) UnmarshalJSON ¶ added in v0.4.0
func (self *MetricType) UnmarshalJSON(b []byte) error
Custom unmarshaller
type Parameters ¶
type SortKey ¶ added in v0.4.0
type SortKey struct { Tenant string Type MetricType }
Click to show internal directories.
Click to hide internal directories.