Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
471e602b
Commit
471e602b
authored
Jan 28, 2016
by
Filip Grzadkowski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20155 from mwielgus/update-heapster-api
Update Heapster API in Godeps
parents
d3fdc61f
b49cba71
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
4 deletions
+34
-4
Godeps.json
Godeps/Godeps.json
+2
-2
model_types.go
...workspace/src/k8s.io/heapster/api/v1/types/model_types.go
+30
-0
horizontal_test.go
pkg/controller/podautoscaler/horizontal_test.go
+1
-1
metrics_client_test.go
pkg/controller/podautoscaler/metrics/metrics_client_test.go
+1
-1
No files found.
Godeps/Godeps.json
View file @
471e602b
...
@@ -990,8 +990,8 @@
...
@@ -990,8 +990,8 @@
},
},
{
{
"ImportPath"
:
"k8s.io/heapster/api/v1/types"
,
"ImportPath"
:
"k8s.io/heapster/api/v1/types"
,
"Comment"
:
"v0.1
7.0-75-g0e1b652
"
,
"Comment"
:
"v0.1
9.1
"
,
"Rev"
:
"0
e1b652781812dee2c51c75180fc590223e0b9c6
"
"Rev"
:
"0
991ac528ea24aae194e45d6dcf01896cb42cbea
"
},
},
{
{
"ImportPath"
:
"speter.net/go/exp/math/dec/inf"
,
"ImportPath"
:
"speter.net/go/exp/math/dec/inf"
,
...
...
Godeps/_workspace/src/k8s.io/heapster/api/v1/types/model_types.go
View file @
471e602b
...
@@ -21,6 +21,10 @@ import (
...
@@ -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 {
...
@@ -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"`
}
pkg/controller/podautoscaler/horizontal_test.go
View file @
471e602b
...
@@ -158,7 +158,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake {
...
@@ -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
)
...
...
pkg/controller/podautoscaler/metrics/metrics_client_test.go
View file @
471e602b
...
@@ -119,7 +119,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake {
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment