Documentation ¶
Index ¶
- Constants
- Variables
- type AggregateBucket
- type AggregateFunction
- type AggregationInterval
- type ByMetricName
- type CounterMetricsResponse
- type Filter
- type FilterOp
- type GaugeMetricsResponse
- type GaugeRow
- type HistogramDistributionData
- type HistogramDistributionResponse
- type HistogramDistributionRow
- type MetricName
- type MetricNameFilters
- type MetricNameGetFn
- type MetricNameResponse
- type MetricNameRow
- type MetricRow
- type MetricSearchMetadataResponse
- type MetricSearchMetadataRow
- type MetricsResponse
- type MockQuerier
- type PerBucketDistribution
- type Querier
- type Query
- type QueryContext
- type QueryData
- type QueryPoint
- type SumMetricsResponse
Constants ¶
View Source
const ( AggregationInterval1m = "1m" // minutely AggregationInterval1h = "1h" // hourly AggregationInterval1d = "1d" // daily )
View Source
const ( GroupByAttributesAll string = "*" GroupByAttributesBucket string = "bucket" )
Variables ¶
View Source
var DailyMetricTables = map[pmetric.MetricType]string{ pmetric.MetricTypeGauge: constants.MetricsGauge1dTableName, pmetric.MetricTypeSum: constants.MetricsSum1dTableName, pmetric.MetricTypeHistogram: constants.MetricsHistogram1dTableName, }
View Source
var HourlyMetricTables = map[pmetric.MetricType]string{ pmetric.MetricTypeGauge: constants.MetricsGauge1hTableName, pmetric.MetricTypeSum: constants.MetricsSum1hTableName, pmetric.MetricTypeHistogram: constants.MetricsHistogram1hTableName, }
View Source
var MinutelyMetricTables = map[pmetric.MetricType]string{ pmetric.MetricTypeGauge: constants.MetricsGauge1mTableName, pmetric.MetricTypeSum: constants.MetricsSum1mTableName, pmetric.MetricTypeHistogram: constants.MetricsHistogram1mTableName, }
View Source
var RawMetricTables = map[pmetric.MetricType]string{ pmetric.MetricTypeGauge: constants.MetricsGaugeTableName, pmetric.MetricTypeSum: constants.MetricsSumTableName, pmetric.MetricTypeHistogram: constants.MetricsHistogramTableName, pmetric.MetricTypeExponentialHistogram: constants.MetricsExponentialHistogramTableName, }
View Source
var SupportedTimeAggregations = []string{ AggregationInterval1m, AggregationInterval1h, AggregationInterval1d, }
Functions ¶
This section is empty.
Types ¶
type AggregateBucket ¶
type AggregateBucket string
const ( Raw AggregateBucket = "main" Minutely AggregateBucket = "1m" Hourly AggregateBucket = "1h" Daily AggregateBucket = "1d" )
type AggregateFunction ¶
type AggregateFunction string
const ( AggregateFunctionSum AggregateFunction = "sum" AggregateFunctionAvg AggregateFunction = "avg" AggregateFunctionMin AggregateFunction = "min" AggregateFunctionMax AggregateFunction = "max" AggregateFunctionCount AggregateFunction = "count" AggregateFunctionP50 AggregateFunction = "p50" AggregateFunctionP75 AggregateFunction = "p75" AggregateFunctionP90 AggregateFunction = "p90" AggregateFunctionP95 AggregateFunction = "p95" AggregateFunctionP99 AggregateFunction = "p99" )
type AggregationInterval ¶
type AggregationInterval string
type ByMetricName ¶
type ByMetricName []MetricName
func (ByMetricName) Len ¶
func (s ByMetricName) Len() int
func (ByMetricName) Less ¶
func (s ByMetricName) Less(i, j int) bool
func (ByMetricName) Swap ¶
func (s ByMetricName) Swap(i, j int)
type CounterMetricsResponse ¶
type GaugeMetricsResponse ¶
type GaugeRow ¶
type GaugeRow struct { MetricName string `ch:"MetricName"` MetricDescription string `ch:"MetricDescription"` MetricUnit string `ch:"MetricUnit"` Fingerprint string `ch:"Fingerprint"` Attributes map[string]string `ch:"Attributes"` Values []float64 `ch:"Values"` LastValues []float64 `ch:"LastValues"` Times []time.Time `ch:"Times"` }
type HistogramDistributionResponse ¶
type HistogramDistributionResponse struct { StartTimestamp int64 `json:"start_ts"` EndTimestamp int64 `json:"end_ts"` Results []HistogramDistributionData `json:"results"` }
type HistogramDistributionRow ¶
type HistogramDistributionRow struct { ProjectID string `ch:"ProjectId"` MetricName string `ch:"MetricName"` MetricDescription string `ch:"MetricDescription"` MetricUnit string `ch:"MetricUnit"` Fingerprint string `ch:"Fingerprint"` StartTimeUnix time.Time `ch:"StartTimeUnix"` AggTimeUnix time.Time `ch:"AggTimeUnix"` AggTemp int32 `ch:"AggTemp"` Min float64 `ch:"Min"` Max float64 `ch:"Max"` Count uint64 `ch:"Count"` Sum float64 `ch:"Sum"` Bounds []float64 `ch:"Bounds"` BoundsHash uint64 `ch:"BoundsHash"` SamplesCount uint64 `ch:"SamplesCount"` Delta []uint64 `ch:"Delta"` Cumulative []uint64 `ch:"Cumulative"` }
type MetricName ¶
type MetricNameFilters ¶
type MetricNameGetFn ¶
type MetricNameGetFn func(context.Context) ([]MetricName, error)
type MetricNameResponse ¶
type MetricNameResponse struct {
Metrics []MetricName `json:"metrics"`
}
type MetricNameRow ¶
type MetricSearchMetadataResponse ¶
type MetricSearchMetadataResponse struct { MetricName string `json:"name"` MetricType string `json:"type"` MetricDescription string `json:"description"` AttributeKeys []string `json:"attribute_keys"` LastIngestedAt int64 `json:"last_ingested_at"` SupportedAggregations []string `json:"supported_aggregations"` SupportedFunctions []string `json:"supported_functions"` DefaultGroupByAttributes []string `json:"default_group_by_attributes"` DefaultGroupByFunction string `json:"default_group_by_function"` }
type MetricSearchMetadataRow ¶
type MetricsResponse ¶
type MockQuerier ¶
type MockQuerier struct{}
func (*MockQuerier) GetMetricNames ¶
func (*MockQuerier) GetMetricNames(_ context.Context, _ *MetricNameFilters) (*MetricNameResponse, error)
func (*MockQuerier) GetMetrics ¶
func (*MockQuerier) GetMetrics(_ context.Context, _ *QueryContext) (interface{}, error)
func (*MockQuerier) GetSearchMetadata ¶
func (*MockQuerier) GetSearchMetadata(_ context.Context, _ *QueryContext) (interface{}, error)
type PerBucketDistribution ¶
type PerBucketDistribution struct { BucketsHash uint64 `json:"bucketsHash"` Buckets []string `json:"buckets"` Distribution [][]QueryPoint `json:"distribution"` }
type Querier ¶
type Querier interface { GetMetricNames(context.Context, *MetricNameFilters) (*MetricNameResponse, error) GetMetrics(context.Context, *QueryContext) (interface{}, error) GetSearchMetadata(context.Context, *QueryContext) (interface{}, error) }
type QueryContext ¶
type QueryPoint ¶
type QueryPoint [2]float64 // time, value
type SumMetricsResponse ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.