Documentation ¶
Index ¶
- func GenerateMetaTags(m MetricMeta, d ObjectMeta) []metrics.MetricTag
- func IsAggregatorMetric(metricName string) bool
- func ParseAggregator(metricName string) (string, string)
- type AggregatedIdentity
- type AggregatedItem
- type AggregatedMetric
- type BasicMetric
- type Item
- type Metric
- type MetricMeta
- type MetricMetaImp
- type ObjectMeta
- type ObjectMetaImp
- type SeriesItem
- type SeriesMetric
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateMetaTags ¶
func GenerateMetaTags(m MetricMeta, d ObjectMeta) []metrics.MetricTag
GenerateMetaTags returns tag based on the given meta-info
func IsAggregatorMetric ¶
IsAggregatorMetric return whether this metric is aggregator metric
func ParseAggregator ¶
ParseAggregator parses the given metricName into aggregator-suffix and origin-metric, and the returned value represents `metric, aggregator`
Types ¶
type AggregatedIdentity ¶
type AggregatedItem ¶
type AggregatedItem struct { AggregatedIdentity `json:",inline"` Value float64 `json:"value,omitempty"` }
func (*AggregatedItem) DeepCopy ¶
func (a *AggregatedItem) DeepCopy() Item
func (*AggregatedItem) GetCount ¶
func (a *AggregatedItem) GetCount() *int64
func (*AggregatedItem) GetQuantity ¶
func (a *AggregatedItem) GetQuantity() resource.Quantity
func (*AggregatedItem) GetTimestamp ¶
func (a *AggregatedItem) GetTimestamp() int64
func (*AggregatedItem) GetWindowSeconds ¶
func (a *AggregatedItem) GetWindowSeconds() *int64
type AggregatedMetric ¶
type AggregatedMetric struct { MetricMetaImp `json:",inline"` ObjectMetaImp `json:",inline"` BasicMetric `json:",inline"` AggregatedIdentity `json:",inline"` Value float64 `json:"values,omitempty"` }
func NewAggregatedInternalMetric ¶
func NewAggregatedInternalMetric(value float64, identity AggregatedIdentity) *AggregatedMetric
func (*AggregatedMetric) DeepCopy ¶
func (as *AggregatedMetric) DeepCopy() Metric
func (*AggregatedMetric) GetBaseMetricMetaImp ¶
func (as *AggregatedMetric) GetBaseMetricMetaImp() MetricMetaImp
func (*AggregatedMetric) GetItemList ¶
func (as *AggregatedMetric) GetItemList() []Item
func (*AggregatedMetric) Len ¶
func (as *AggregatedMetric) Len() int
func (*AggregatedMetric) String ¶
func (as *AggregatedMetric) String() string
type BasicMetric ¶
func (*BasicMetric) DeepCopy ¶
func (m *BasicMetric) DeepCopy() BasicMetric
func (*BasicMetric) GetLabels ¶
func (m *BasicMetric) GetLabels() map[string]string
func (*BasicMetric) String ¶
func (m *BasicMetric) String() string
type Item ¶
type Item interface { DeepCopy() Item // GetQuantity returns the value for this metric GetQuantity() resource.Quantity // GetTimestamp returns the timestamp that this metric was generated GetTimestamp() int64 // GetCount returns the total amount of raw metrics that generates this GetCount() *int64 // GetWindowSeconds returns the time-window that this the raw metrics represent for GetWindowSeconds() *int64 }
Item represents the standard format of metric-item in local cache
type Metric ¶
type Metric interface { MetricMeta ObjectMeta DeepCopy() Metric // String returns a standard format for this metricItem // GetLabels/SetLabels maintains the labels in Metric String() string GetLabels() map[string]string // Len returns length for Item // GetItemList returns a list for Item Len() int GetItemList() []Item }
func DecodeMetricList ¶
func DecodeMetricList(body io.ReadCloser, metricName string) (res []Metric, err error)
func UnmarshalMetricList ¶
type MetricMeta ¶
func DecodeMetricMetaList ¶
func DecodeMetricMetaList(body io.ReadCloser) (res []MetricMeta, err error)
func PackMetricMetaList ¶
func PackMetricMetaList(metricMetaLists ...[]MetricMeta) []MetricMeta
PackMetricMetaList merges MetricMetaImp lists and removes duplicates
type MetricMetaImp ¶
type MetricMetaImp struct { Name string `json:"name,omitempty"` Namespaced bool `json:"namespaced,omitempty"` ObjectKind string `json:"objectKind,omitempty"` }
func AggregatorMetricMetaImp ¶
func AggregatorMetricMetaImp(origin MetricMetaImp, aggName string) MetricMetaImp
func (MetricMetaImp) DeepCopy ¶
func (m MetricMetaImp) DeepCopy() MetricMetaImp
func (MetricMetaImp) GetName ¶
func (m MetricMetaImp) GetName() string
func (MetricMetaImp) GetNamespaced ¶
func (m MetricMetaImp) GetNamespaced() bool
func (MetricMetaImp) GetObjectKind ¶
func (m MetricMetaImp) GetObjectKind() string
type ObjectMeta ¶
type ObjectMetaImp ¶
type ObjectMetaImp struct { ObjectNamespace string `json:"objectNamespace,omitempty"` ObjectName string `json:"objectName,omitempty"` }
func (ObjectMetaImp) DeepCopy ¶
func (m ObjectMetaImp) DeepCopy() ObjectMetaImp
func (ObjectMetaImp) GetObjectName ¶
func (m ObjectMetaImp) GetObjectName() string
func (ObjectMetaImp) GetObjectNamespace ¶
func (m ObjectMetaImp) GetObjectNamespace() string
type SeriesItem ¶
type SeriesItem struct { Value float64 `json:"value,omitempty"` Timestamp int64 `json:"timestamp,omitempty"` }
func NewInternalItem ¶
func NewInternalItem(value float64, timestamp int64) *SeriesItem
func (*SeriesItem) DeepCopy ¶
func (i *SeriesItem) DeepCopy() Item
func (*SeriesItem) GetCount ¶
func (i *SeriesItem) GetCount() *int64
func (*SeriesItem) GetQuantity ¶
func (i *SeriesItem) GetQuantity() resource.Quantity
func (*SeriesItem) GetTimestamp ¶
func (i *SeriesItem) GetTimestamp() int64
func (*SeriesItem) GetWindowSeconds ¶
func (i *SeriesItem) GetWindowSeconds() *int64
type SeriesMetric ¶
type SeriesMetric struct { MetricMetaImp `json:",inline"` ObjectMetaImp `json:",inline"` BasicMetric `json:",inline"` Values []*SeriesItem `json:"values,omitempty"` }
func NewSeriesMetric ¶
func NewSeriesMetric() *SeriesMetric
func (*SeriesMetric) AddMetric ¶
func (is *SeriesMetric) AddMetric(item *SeriesItem)
func (*SeriesMetric) DeepCopy ¶
func (is *SeriesMetric) DeepCopy() Metric
func (*SeriesMetric) GetItemList ¶
func (is *SeriesMetric) GetItemList() []Item
func (*SeriesMetric) Len ¶
func (is *SeriesMetric) Len() int
func (*SeriesMetric) String ¶
func (is *SeriesMetric) String() string
Click to show internal directories.
Click to hide internal directories.