mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Update Heapster API in Godeps
This commit is contained in:
parent
6c63acdd3d
commit
b49cba7182
4
Godeps/Godeps.json
generated
4
Godeps/Godeps.json
generated
@ -985,8 +985,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/heapster/api/v1/types",
|
"ImportPath": "k8s.io/heapster/api/v1/types",
|
||||||
"Comment": "v0.17.0-75-g0e1b652",
|
"Comment": "v0.19.1",
|
||||||
"Rev": "0e1b652781812dee2c51c75180fc590223e0b9c6"
|
"Rev": "0991ac528ea24aae194e45d6dcf01896cb42cbea"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "speter.net/go/exp/math/dec/inf",
|
"ImportPath": "speter.net/go/exp/math/dec/inf",
|
||||||
|
30
Godeps/_workspace/src/k8s.io/heapster/api/v1/types/model_types.go
generated
vendored
30
Godeps/_workspace/src/k8s.io/heapster/api/v1/types/model_types.go
generated
vendored
@ -21,6 +21,10 @@ import (
|
|||||||
type MetricPoint struct {
|
type MetricPoint struct {
|
||||||
Timestamp time.Time `json:"timestamp"`
|
Timestamp time.Time `json:"timestamp"`
|
||||||
Value uint64 `json:"value"`
|
Value uint64 `json:"value"`
|
||||||
|
// This will be populated only for float custom metrics. In that case
|
||||||
|
// "value" will be zero. This is a temporary hack. Overall most likely
|
||||||
|
// we will need a new api versioned in the similar way as K8S api.
|
||||||
|
FloatValue *float64 `json:"floatValue,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetricResult struct {
|
type MetricResult struct {
|
||||||
@ -31,3 +35,29 @@ type MetricResult struct {
|
|||||||
type MetricResultList struct {
|
type MetricResultList struct {
|
||||||
Items []MetricResult `json:"items"`
|
Items []MetricResult `json:"items"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Stats struct {
|
||||||
|
Average uint64 `json:"average"`
|
||||||
|
NinetyFifth uint64 `json:"percentile"`
|
||||||
|
Max uint64 `json:"max"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ExternalStatBundle struct {
|
||||||
|
Minute Stats `json:"minute"`
|
||||||
|
Hour Stats `json:"hour"`
|
||||||
|
Day Stats `json:"day"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type StatsResponse struct {
|
||||||
|
// Uptime is in seconds
|
||||||
|
Uptime uint64 `json:"uptime"`
|
||||||
|
Stats map[string]ExternalStatBundle `json:"stats"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// An ExternalEntityListEntry represents the latest CPU and Memory usage of a model entity.
|
||||||
|
// A model entity can be a Pod, a Container, a Namespace or a Node.
|
||||||
|
type ExternalEntityListEntry struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
CPUUsage uint64 `json:"cpuUsage"`
|
||||||
|
MemUsage uint64 `json:"memUsage"`
|
||||||
|
}
|
||||||
|
@ -158,7 +158,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake {
|
|||||||
metrics := heapster.MetricResultList{}
|
metrics := heapster.MetricResultList{}
|
||||||
for _, level := range tc.reportedLevels {
|
for _, level := range tc.reportedLevels {
|
||||||
metric := heapster.MetricResult{
|
metric := heapster.MetricResult{
|
||||||
Metrics: []heapster.MetricPoint{{timestamp, level}},
|
Metrics: []heapster.MetricPoint{{timestamp, level, nil}},
|
||||||
LatestTimestamp: timestamp,
|
LatestTimestamp: timestamp,
|
||||||
}
|
}
|
||||||
metrics.Items = append(metrics.Items, metric)
|
metrics.Items = append(metrics.Items, metric)
|
||||||
|
@ -119,7 +119,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake {
|
|||||||
if latestTimestamp.Before(timestamp) {
|
if latestTimestamp.Before(timestamp) {
|
||||||
latestTimestamp = timestamp
|
latestTimestamp = timestamp
|
||||||
}
|
}
|
||||||
heapsterMetricPoint := heapster.MetricPoint{timestamp, reportedMetricPoint.level}
|
heapsterMetricPoint := heapster.MetricPoint{timestamp, reportedMetricPoint.level, nil}
|
||||||
heapsterMetricPoints = append(heapsterMetricPoints, heapsterMetricPoint)
|
heapsterMetricPoints = append(heapsterMetricPoints, heapsterMetricPoint)
|
||||||
}
|
}
|
||||||
metric := heapster.MetricResult{
|
metric := heapster.MetricResult{
|
||||||
|
Loading…
Reference in New Issue
Block a user