Debian Codegraph @

pkg/apis/external_metrics/v1beta1/types.go

raw
1 /*
2 Copyright 2018 The Kubernetes Authors.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17 package v1beta1
18
19 import (
20 "k8s.io/apimachinery/pkg/api/resource"
21 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22 )
23
24 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
25
26 // ExternalMetricValueList is a list of values for a given metric for some set labels
27 type ExternalMetricValueList struct {
28 metav1.TypeMeta `json:",inline"`
29 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
30
31 // value of the metric matching a given set of labels
32 Items []ExternalMetricValue `json:"items" protobuf:"bytes,2,rep,name=items"`
33 }
34
35 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
36
37 // ExternalMetricValue is a metric value for external metric
38 // A single metric value is identified by metric name and a set of string labels.
39 // For one metric there can be multiple values with different sets of labels.
40 type ExternalMetricValue struct {
41 metav1.TypeMeta `json:",inline"`
42
43 // the name of the metric
44 MetricName string `json:"metricName" protobuf:"bytes,1,name=metricName"`
45
46 // a set of labels that identify a single time series for the metric
47 MetricLabels map[string]string `json:"metricLabels" protobuf:"bytes,2,rep,name=metricLabels"`
48
49 // indicates the time at which the metrics were produced
50 Timestamp metav1.Time `json:"timestamp" protobuf:"bytes,3,name=timestamp"`
51
52 // indicates the window ([Timestamp-Window, Timestamp]) from
53 // which these metrics were calculated, when returning rate
54 // metrics calculated from cumulative metrics (or zero for
55 // non-calculated instantaneous metrics).
56 WindowSeconds *int64 `json:"window,omitempty" protobuf:"bytes,4,opt,name=window"`
57
58 // the value of the metric
59 Value resource.Quantity `json:"value" protobuf:"bytes,5,name=value"`
60 }