Documentation ¶
Index ¶
Constants ¶
const ( // time FifteenMinutes = "15m" TenMinutes = "10m" FiveMinutes = "5m" // operator Average = "Avg" Std = "Std" Latest = "Latest" UnknownOperator = "Unknown" Capacity = "Capacity" // Resource CPU = "cpu" Memory = "memory" Ephemeral_storage = "ephemeral_storage" Hugepages_2Mi = "hugepages_2Mi" Pods = "pods" Network = "network" Disk = "disk" // unit Ratio = "ratio" Core = "core" Integer = "integer" Byte = "byte" MiB = "MiB" M = "m" ALL_COURSE_LABEL = "all" DEFAULT_COURSE_LABEL = "label_course_id" NODE_DISK_SATURATION = "node_disk_saturation" KUBE_NODE_STATUS_CAPACITY = "kube_node_status_capacity" NODE_NETWORK_RECEIVE_BYTES_EXCLUDING_LO = "node_network_receive_bytes_excluding_lo" NODE_NETWORK_TRANSMIT_BYTES_EXCLUDING_LO = "node_network_transmit_bytes_excluding_lo" // NODE_NETWORK_TOTAL_BYTES_EXCLUDING_LO = "node_network_total_bytes_excluding_lo" NODE_NETWORK_TOTAL_BYTES_PERCENTAGE_EXCLUDING_LO = "node_network_total_bytes_percentage_excluding_lo" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct {
NodeMetricsMap NodeMetricsMap
}
func (*Data) MarshalJSONObject ¶
MarshalJSONObject implements MarshalerJSONObject
type Metadata ¶
type Metadata struct {
DataCenter string `json:"dataCenter,omitempty"`
}
func (*Metadata) MarshalJSONObject ¶
MarshalJSONObject implements MarshalerJSONObject
type Metric ¶
type Metric struct { Name string `json:"name"` // Name of metric at the provider Type string `json:"type,omitempty"` // CPU or Memory Operator string `json:"operator,omitempty"` // STD or AVE or SUM, etc. Rollup string `json:"rollup,omitempty"` // Rollup used for metric calculation Unit string `json:"unit,omitempty"` // Unit of Value Value float64 `json:"value"` // Value is expected to be in % }
func (*Metric) MarshalJSONObject ¶
MarshalJSONObject implements MarshalerJSONObject
type NodeMetrics ¶
type NodeMetrics struct { Metrics []Metric `json:"metrics,omitempty"` Tags Tags `json:"tags,omitempty"` Metadata Metadata `json:"metadata,omitempty"` }
func (*NodeMetrics) MarshalJSONObject ¶
func (m *NodeMetrics) MarshalJSONObject(enc *gojay.Encoder)
MarshalJSONObject implements MarshalerJSONObject
func (*NodeMetrics) NKeys ¶
func (m *NodeMetrics) NKeys() int
NKeys returns the number of keys to unmarshal
func (*NodeMetrics) UnmarshalJSONObject ¶
func (m *NodeMetrics) UnmarshalJSONObject(dec *gojay.Decoder, k string) error
UnmarshalJSONObject implements gojay's UnmarshalerJSONObject
type NodeMetricsMap ¶
type NodeMetricsMap map[string]NodeMetrics
func (*NodeMetricsMap) IsNil ¶
func (m *NodeMetricsMap) IsNil() bool
IsNil checks if instance is nil
func (*NodeMetricsMap) MarshalJSONObject ¶
func (m *NodeMetricsMap) MarshalJSONObject(enc *gojay.Encoder)
MarshalJSONObject implements MarshalerJSONObject
func (*NodeMetricsMap) NKeys ¶
func (m *NodeMetricsMap) NKeys() int
NKeys returns the number of keys to unmarshal
func (*NodeMetricsMap) UnmarshalJSONObject ¶
func (m *NodeMetricsMap) UnmarshalJSONObject(dec *gojay.Decoder, k string) error
UnmarshalJSONObject implements gojay's UnmarshalerJSONObject
type StatisticsData ¶
type StatisticsData struct {
StatisticsMap NodeMetricsMap
}
func (*StatisticsData) IsNil ¶
func (d *StatisticsData) IsNil() bool
IsNil checks if instance is nil
func (*StatisticsData) MarshalJSONObject ¶
func (d *StatisticsData) MarshalJSONObject(enc *gojay.Encoder)
MarshalJSONObject implements MarshalerJSONObject
func (*StatisticsData) NKeys ¶
func (d *StatisticsData) NKeys() int
NKeys returns the number of keys to unmarshal
func (*StatisticsData) UnmarshalJSONObject ¶
func (d *StatisticsData) UnmarshalJSONObject(dec *gojay.Decoder, k string) error
UnmarshalJSONObject implements gojay's UnmarshalerJSONObject
type Tags ¶
type Tags struct { }
func (*Tags) MarshalJSONObject ¶
MarshalJSONObject implements MarshalerJSONObject
type WatcherMetrics ¶
type WatcherMetrics struct { Timestamp int64 `json:"timestamp"` Window Window `json:"window"` Source string `json:"source"` Data Data `json:"data"` Statistics StatisticsData `json:"statistics"` }
func (*WatcherMetrics) IsNil ¶
func (m *WatcherMetrics) IsNil() bool
IsNil checks if instance is nil
func (*WatcherMetrics) MarshalJSONObject ¶
func (m *WatcherMetrics) MarshalJSONObject(enc *gojay.Encoder)
MarshalJSONObject implements MarshalerJSONObject
func (*WatcherMetrics) NKeys ¶
func (m *WatcherMetrics) NKeys() int
NKeys returns the number of keys to unmarshal
func (*WatcherMetrics) UnmarshalJSONObject ¶
func (m *WatcherMetrics) UnmarshalJSONObject(dec *gojay.Decoder, k string) error
UnmarshalJSONObject implements gojay's UnmarshalerJSONObject
type Window ¶
type Window struct { Duration string `json:"duration"` Start int64 `json:"start"` End int64 `json:"end"` }
func CurrentFifteenMinuteWindow ¶
func CurrentFifteenMinuteWindow() *Window
func CurrentFiveMinuteWindow ¶
func CurrentFiveMinuteWindow() *Window
func CurrentTenMinuteWindow ¶
func CurrentTenMinuteWindow() *Window
func (*Window) MarshalJSONObject ¶
MarshalJSONObject implements MarshalerJSONObject