Documentation ¶
Index ¶
- Constants
- type AbsoluteTimeRange
- type Aggregation
- type AggregationType
- type Backend
- type ChainingAggregation
- type Client
- func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*http.Response, error)
- func (c *Client) NewRequest(method, urlstr string, body interface{}) (*http.Request, error)
- func (c *Client) QueryMetrics(ctx context.Context, query *QueryMetricsRequest) (*QueryMetricsResponse, error)
- func (c *Client) Status(ctx context.Context) (*StatusResponse, error)
- type Cluster
- type Consumer
- type Filter
- type FilteringAggregation
- type GroupingAggregation
- type MetadataBackend
- type NodeError
- type QueryError
- type QueryMetricsRequest
- type QueryMetricsResponse
- type RelativeTimeRange
- type RequestError
- type Sample
- type SamplingAggregation
- type ServiceInfo
- type ShardError
- type ShardedResultGroup
- type Statistics
- type Status
- type StatusResponse
- type TimeRange
- type TimeRangeType
- type TimeUnit
Constants ¶
View Source
const ( // DefaultURL is the default host to use when none is given. DefaultURL = "http://localhost" // DefaultPort is the default host to use when none is given. DefaultPort = 8080 )
View Source
const ( Milliseconds = TimeUnit("MILLISECONDS") Seconds = TimeUnit("SECONDS") Minutes = TimeUnit("MINUTES") Hours = TimeUnit("HOURS") Days = TimeUnit("DAYS") Weeks = TimeUnit("WEEKS") Months = TimeUnit("MONTHS") )
View Source
const ( Absolute = TimeRangeType("absolute") Relative = TimeRangeType("relative") )
View Source
const ( // sampling Min = AggregationType("min") Max = AggregationType("max") Average = AggregationType("average") Sum = AggregationType("sum") // chaining Chain = AggregationType("chain") // grouping Group = AggregationType("group") // filtering TopK = AggregationType("topk") BottomK = AggregationType("bottomk") AboveK = AggregationType("abovek") BelowK = AggregationType("belowk") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbsoluteTimeRange ¶
type AbsoluteTimeRange struct { Type TimeRangeType `json:"type,omitempty"` Start int64 `json:"start"` End int64 `json:"end"` }
type Aggregation ¶
type Aggregation interface{}
type AggregationType ¶
type AggregationType string
type ChainingAggregation ¶
type ChainingAggregation struct { Type AggregationType `json:"type"` Chain []Aggregation `json:"chain"` }
type Client ¶
type Client struct { // Base URL for API requests. Must include a trailing slash. BaseURL *url.URL // contains filtered or unexported fields }
Client is a heroic client
func NewClient ¶
NewClient returns a new heroic client with the given baseURL and httpClient. If no baseURL is provided, the DefaultURL and DefaultPort will be used. If no httpClient is provided, the http.DefaultClient will be used. If clientId provided it will be send as the X-Client-Id header.
func (*Client) NewRequest ¶
func (*Client) QueryMetrics ¶
func (c *Client) QueryMetrics(ctx context.Context, query *QueryMetricsRequest) (*QueryMetricsResponse, error)
type FilteringAggregation ¶
type FilteringAggregation struct { Type AggregationType `json:"type"` K int `json:"k"` }
type GroupingAggregation ¶
type GroupingAggregation struct { Type AggregationType `json:"type"` Of []string `json:"of"` Each Aggregation `json:"each"` }
type MetadataBackend ¶
type MetadataBackend struct {
*Status
}
type QueryError ¶
type QueryMetricsRequest ¶
type QueryMetricsRequest struct { Range TimeRange `json:"range"` Filter Filter `json:"filter"` Aggregation Aggregation `json:"aggregation"` }
type QueryMetricsResponse ¶
type QueryMetricsResponse struct { Range AbsoluteTimeRange `json:"range"` Errors []RequestError `json:"errors"` Result []ShardedResultGroup `json:"result"` Statistics Statistics `json:"statistics"` }
type RelativeTimeRange ¶
type RelativeTimeRange struct { Type TimeRangeType `json:"type"` Unit TimeUnit `json:"unit"` Value int `json:"value"` }
type RequestError ¶
type RequestError struct {
Type string `json:"type"`
}
type SamplingAggregation ¶
type SamplingAggregation struct { Type AggregationType `json:"type"` Sampling Sample `json:"sampling"` }
type ServiceInfo ¶
type ShardError ¶
type ShardedResultGroup ¶
type Statistics ¶
type StatusResponse ¶
type StatusResponse struct { Ok bool `json:"ok"` Service ServiceInfo `json:"service"` Consumers Consumer `json:"consumers"` Backends Backend `json:"backends"` MetadataBackends MetadataBackend `json:"metadataBackends"` Cluster Cluster `json:"cluster"` }
type TimeRangeType ¶
type TimeRangeType string
Click to show internal directories.
Click to hide internal directories.