Documentation ¶
Index ¶
- Constants
- func ConvertToFloat64(v interface{}) (float64, error)
- func UnixMilli(t time.Time) int64
- type Bucketpoint
- type Client
- func (c *Client) Close()
- func (c *Client) Create(md MetricDefinition, o ...Modifier) (bool, error)
- func (c *Client) Definition(t MetricType, id string, o ...Modifier) (*MetricDefinition, error)
- func (c *Client) Definitions(o ...Modifier) ([]*MetricDefinition, error)
- func (c *Client) DeleteTags(t MetricType, id string, tags map[string]string, o ...Modifier) error
- func (c *Client) ReadBuckets(t MetricType, o ...Modifier) ([]*Bucketpoint, error)
- func (c *Client) ReadMetric(t MetricType, id string, o ...Modifier) ([]*Datapoint, error)
- func (c *Client) Send(o ...Modifier) (*http.Response, error)
- func (c *Client) Tags(t MetricType, id string, o ...Modifier) (map[string]string, error)
- func (c *Client) UpdateTags(t MetricType, id string, tags map[string]string, o ...Modifier) error
- func (c *Client) Url(method string, e ...Endpoint) Modifier
- func (c *Client) Write(metrics []MetricHeader, o ...Modifier) error
- type Datapoint
- type Endpoint
- type Filter
- func BucketsFilter(buckets int) Filter
- func EndTimeFilter(endTime time.Time) Filter
- func IdFilter(regexp string) Filter
- func LimitFilter(limit int) Filter
- func OrderFilter(order Order) Filter
- func Param(k string, v string) Filter
- func PercentilesFilter(percentiles []float64) Filter
- func StackedFilter() Filter
- func StartFromBeginningFilter() Filter
- func StartTimeFilter(startTime time.Time) Filter
- func TagsFilter(t map[string]string) Filter
- func TypeFilter(t MetricType) Filter
- type HawkularClient
- type HawkularClientError
- type HawkularError
- type MetricDefinition
- type MetricHeader
- type MetricType
- type Modifier
- type Order
- type Parameters
- type Percentile
Constants ¶
const ( Gauge = iota Availability Counter Generic )
const ( // ASC Ascending ASC = iota // DESC Descending DESC )
Variables ¶
This section is empty.
Functions ¶
func ConvertToFloat64 ¶
ConvertToFloat64 Return float64 from most numeric types
Types ¶
type Bucketpoint ¶
type Bucketpoint struct { Start int64 `json:"start"` End int64 `json:"end"` Min float64 `json:"min"` Max float64 `json:"max"` Avg float64 `json:"avg"` Median float64 `json:"median"` Empty bool `json:"empty"` Samples int64 `json:"samples"` Percentiles []Percentile `json:"percentiles"` }
Bucketpoint Return structure for bucketed data
type Client ¶
Client HawkularClient's data structure
func NewHawkularClient ¶
func NewHawkularClient(p Parameters) (*Client, error)
NewHawkularClient Initialization
func (*Client) Close ¶
func (c *Client) Close()
Close Safely close the Hawkular-Metrics client and flush remaining work
func (*Client) Create ¶
func (c *Client) Create(md MetricDefinition, o ...Modifier) (bool, error)
Create Creates new metric Definition
func (*Client) Definition ¶
func (c *Client) Definition(t MetricType, id string, o ...Modifier) (*MetricDefinition, error)
Definition Return a single definition
func (*Client) Definitions ¶
func (c *Client) Definitions(o ...Modifier) ([]*MetricDefinition, error)
Definitions Fetch metric definitions
func (*Client) DeleteTags ¶
DeleteTags Delete given tags from the definition
func (*Client) ReadBuckets ¶
func (c *Client) ReadBuckets(t MetricType, o ...Modifier) ([]*Bucketpoint, error)
ReadBuckets Read datapoints from the server with in buckets (aggregates)
func (*Client) ReadMetric ¶ added in v0.18.1
ReadMetric Read metric datapoints from the server
func (*Client) Send ¶ added in v0.18.1
Send Sends a constructed request to the Hawkular-Metrics server
func (*Client) UpdateTags ¶
UpdateTags Update tags of a metric (or create if not existing)
type Datapoint ¶
type Datapoint struct { Timestamp int64 `json:"timestamp"` Value interface{} `json:"value"` Tags map[string]string `json:"tags,omitempty"` }
Datapoint Value should be convertible to float64 for numeric values, Timestamp is milliseconds since epoch
type Endpoint ¶ added in v0.18.1
Endpoint Endpoint type to define request URL
func DataEndpoint ¶ added in v0.18.1
func DataEndpoint() Endpoint
DataEndpoint URL endpoint for inserting / requesting datapoints
func SingleMetricEndpoint ¶ added in v0.18.1
SingleMetricEndpoint URL endpoint for requesting single metricID
func TagEndpoint ¶ added in v0.18.1
func TagEndpoint() Endpoint
TagEndpoint URL endpoint to check tags information
func TagsEndpoint ¶ added in v0.18.1
TagsEndpoint URL endpoint which adds tags query
func TypeEndpoint ¶ added in v0.18.1
func TypeEndpoint(t MetricType) Endpoint
TypeEndpoint URL endpoint setting metricType
type Filter ¶ added in v0.18.1
Filter Filter type for querying
func BucketsFilter ¶ added in v0.18.1
BucketsFilter Query parameter to define amount of buckets
func EndTimeFilter ¶ added in v0.18.1
EndTimeFilter Query parameter to filter with end time
func LimitFilter ¶
LimitFilter Query parameter to limit result count
func OrderFilter ¶
OrderFilter Query parameter to define the ordering of datapoints
func PercentilesFilter ¶
PercentilesFilter Query parameter to define the requested percentiles
func StackedFilter ¶
func StackedFilter() Filter
StackedFilter Force downsampling of stacked return values
func StartFromBeginningFilter ¶
func StartFromBeginningFilter() Filter
StartFromBeginningFilter Return data from the oldest stored datapoint
func StartTimeFilter ¶ added in v0.18.1
StartTimeFilter Query parameter to filter with start time
func TagsFilter ¶ added in v0.18.1
TagsFilter Query parameter filtering with tags
func TypeFilter ¶ added in v0.18.1
func TypeFilter(t MetricType) Filter
TypeFilter Query parameter filtering with type
type HawkularClient ¶ added in v0.18.1
HawkularClient HawkularClient base type to define available functions..
type HawkularClientError ¶
type HawkularClientError struct { Code int // contains filtered or unexported fields }
HawkularClientError Extracted error information from Hawkular-Metrics server
func (*HawkularClientError) Error ¶
func (c *HawkularClientError) Error() string
type HawkularError ¶
type HawkularError struct {
ErrorMsg string `json:"errorMsg"`
}
HawkularError Return payload from Hawkular-Metrics if processing failed
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.18.1
func (mt MetricType) MarshalJSON() ([]byte, error)
MarshalJSON Custom marshaller for MetricType
func (MetricType) String ¶
func (mt MetricType) String() string
String Get string representation of type
func (*MetricType) UnmarshalJSON ¶ added in v0.18.1
func (mt *MetricType) UnmarshalJSON(b []byte) error
UnmarshalJSON Custom unmarshaller for MetricType
type Modifier ¶ added in v0.18.1
Modifier Modifiers base type
type Parameters ¶
type Parameters struct { Tenant string // Technically optional, but requires setting Tenant() option everytime Url string TLSConfig *tls.Config Token string Concurrency int }
Parameters Initialization parameters to the client
type Percentile ¶
Percentile Hawkular-Metrics calculated percentiles representation