Update Heapster API in Godeps

This commit is contained in:
Marcin Wielgus 2016-01-26 16:45:46 +01:00
parent 6c63acdd3d
commit b49cba7182
4 changed files with 34 additions and 4 deletions

4
Godeps/Godeps.json generated
View File

@ -985,8 +985,8 @@
},
{
"ImportPath": "k8s.io/heapster/api/v1/types",
"Comment": "v0.17.0-75-g0e1b652",
"Rev": "0e1b652781812dee2c51c75180fc590223e0b9c6"
"Comment": "v0.19.1",
"Rev": "0991ac528ea24aae194e45d6dcf01896cb42cbea"
},
{
"ImportPath": "speter.net/go/exp/math/dec/inf",

View File

@ -21,6 +21,10 @@ import (
type MetricPoint struct {
Timestamp time.Time `json:"timestamp"`
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 {
@ -31,3 +35,29 @@ type MetricResult struct {
type MetricResultList struct {
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"`
}

View File

@ -158,7 +158,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake {
metrics := heapster.MetricResultList{}
for _, level := range tc.reportedLevels {
metric := heapster.MetricResult{
Metrics: []heapster.MetricPoint{{timestamp, level}},
Metrics: []heapster.MetricPoint{{timestamp, level, nil}},
LatestTimestamp: timestamp,
}
metrics.Items = append(metrics.Items, metric)

View File

@ -119,7 +119,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake {
if latestTimestamp.Before(timestamp) {
latestTimestamp = timestamp
}
heapsterMetricPoint := heapster.MetricPoint{timestamp, reportedMetricPoint.level}
heapsterMetricPoint := heapster.MetricPoint{timestamp, reportedMetricPoint.level, nil}
heapsterMetricPoints = append(heapsterMetricPoints, heapsterMetricPoint)
}
metric := heapster.MetricResult{