-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathmonitor_metrics_definitions.go
More file actions
65 lines (57 loc) · 2.65 KB
/
monitor_metrics_definitions.go
File metadata and controls
65 lines (57 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package linodego
import (
"context"
)
// MonitorMetricsDefinition represents an ACLP MetricsDefinition object
type MonitorMetricsDefinition struct {
AvailableAggregateFunctions []AggregateFunction `json:"available_aggregate_functions"`
Dimensions []MonitorDimension `json:"dimensions"`
IsAlertable bool `json:"is_alertable"`
Label string `json:"label"`
Metric string `json:"metric"`
MetricType MetricType `json:"metric_type"`
ScrapeInterval string `json:"scrape_interval"`
Unit MetricUnit `json:"unit"`
}
// MetricType is an enum object for MetricType
type MetricType string
const (
MetricTypeCounter MetricType = "counter"
MetricTypeHistogram MetricType = "histogram"
MetricTypeGauge MetricType = "gauge"
MetricTypeSummary MetricType = "summary"
)
// MetricUnit is an enum object for Unit
type MetricUnit string
const (
MetricUnitCount MetricUnit = "count"
MetricUnitPercent MetricUnit = "percent"
MetricUnitByte MetricUnit = "byte"
MetricUnitSecond MetricUnit = "second"
MetricUnitBitsPerSecond MetricUnit = "bits_per_second"
MetricUnitMillisecond MetricUnit = "millisecond"
MetricUnitKB MetricUnit = "KB"
MetricUnitMB MetricUnit = "MB"
MetricUnitGB MetricUnit = "GB"
MetricUnitRate MetricUnit = "rate"
MetricUnitBytesPerSecond MetricUnit = "bytes_per_second"
MetricUnitPercentile MetricUnit = "percentile"
MetricUnitRatio MetricUnit = "ratio"
MetricUnitOpsPerSecond MetricUnit = "ops_per_second"
MetricUnitIops MetricUnit = "iops"
MetricUnitKiloBytesPerSecond MetricUnit = "kilo_bytes_per_second"
MetricUnitSessionsPerSecond MetricUnit = "sessions_per_second"
MetricUnitPacketsPerSecond MetricUnit = "packets_per_second"
MetricUnitKiloBitsPerSecond MetricUnit = "kilo_bits_per_second"
)
// MonitorDimension represents an ACLP MonitorDimension object
type MonitorDimension struct {
DimensionLabel string `json:"dimension_label"`
Label string `json:"label"`
Values []string `json:"values"`
}
// ListMonitorMetricsDefinitionByServiceType lists metric definitions
func (c *Client) ListMonitorMetricsDefinitionByServiceType(ctx context.Context, serviceType string, opts *ListOptions) ([]MonitorMetricsDefinition, error) {
e := formatAPIPath("monitor/services/%s/metric-definitions", serviceType)
return getPaginatedResults[MonitorMetricsDefinition](ctx, c, e, opts)
}