metricstype

package
v1.15.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
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) IsNil

func (d *Data) IsNil() bool

IsNil checks if instance is nil

func (*Data) MarshalJSONObject

func (d *Data) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Data) NKeys

func (d *Data) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Data) UnmarshalJSONObject

func (d *Data) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Metadata

type Metadata struct {
	DataCenter string `json:"dataCenter,omitempty"`
}

func (*Metadata) IsNil

func (m *Metadata) IsNil() bool

IsNil checks if instance is nil

func (*Metadata) MarshalJSONObject

func (m *Metadata) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Metadata) NKeys

func (m *Metadata) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Metadata) UnmarshalJSONObject

func (m *Metadata) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

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) IsNil

func (m *Metric) IsNil() bool

IsNil checks if instance is nil

func (*Metric) MarshalJSONObject

func (m *Metric) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Metric) NKeys

func (m *Metric) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Metric) UnmarshalJSONObject

func (m *Metric) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Metrices

type Metrices []Metric

func (Metrices) IsNil

func (s Metrices) IsNil() bool

func (Metrices) MarshalJSONArray

func (s Metrices) MarshalJSONArray(enc *gojay.Encoder)

func (*Metrices) UnmarshalJSONArray

func (s *Metrices) UnmarshalJSONArray(dec *gojay.Decoder) error

type NodeMetrics

type NodeMetrics struct {
	Metrics  []Metric `json:"metrics,omitempty"`
	Tags     Tags     `json:"tags,omitempty"`
	Metadata Metadata `json:"metadata,omitempty"`
}

func (*NodeMetrics) IsNil

func (m *NodeMetrics) IsNil() bool

IsNil checks if instance is nil

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) IsNil

func (t *Tags) IsNil() bool

IsNil checks if instance is nil

func (*Tags) MarshalJSONObject

func (t *Tags) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Tags) NKeys

func (t *Tags) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Tags) UnmarshalJSONObject

func (t *Tags) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

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) IsNil

func (w *Window) IsNil() bool

IsNil checks if instance is nil

func (*Window) MarshalJSONObject

func (w *Window) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Window) NKeys

func (w *Window) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Window) UnmarshalJSONObject

func (w *Window) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL