mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Update cAdvisor dependency.
Includes new handling of ContainerInfoRequest.
This commit is contained in:
parent
9615849874
commit
eeb62634d2
64
Godeps/Godeps.json
generated
64
Godeps/Godeps.json
generated
@ -212,83 +212,83 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/api",
|
"ImportPath": "github.com/google/cadvisor/api",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/container",
|
"ImportPath": "github.com/google/cadvisor/container",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/events",
|
"ImportPath": "github.com/google/cadvisor/events",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/fs",
|
"ImportPath": "github.com/google/cadvisor/fs",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/healthz",
|
"ImportPath": "github.com/google/cadvisor/healthz",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/http",
|
"ImportPath": "github.com/google/cadvisor/http",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/info/v1",
|
"ImportPath": "github.com/google/cadvisor/info/v1",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/info/v2",
|
"ImportPath": "github.com/google/cadvisor/info/v2",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/manager",
|
"ImportPath": "github.com/google/cadvisor/manager",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/metrics",
|
"ImportPath": "github.com/google/cadvisor/metrics",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/pages",
|
"ImportPath": "github.com/google/cadvisor/pages",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/storage",
|
"ImportPath": "github.com/google/cadvisor/storage",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/summary",
|
"ImportPath": "github.com/google/cadvisor/summary",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/utils",
|
"ImportPath": "github.com/google/cadvisor/utils",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/validate",
|
"ImportPath": "github.com/google/cadvisor/validate",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/version",
|
"ImportPath": "github.com/google/cadvisor/version",
|
||||||
"Comment": "0.10.1-103-gbfaf70b",
|
"Comment": "0.10.1-106-gfd9f7e0",
|
||||||
"Rev": "bfaf70b2555fcaba212130da04a21302344e38f5"
|
"Rev": "fd9f7e0e820c7916e052e2180ee51e5ef8ad6614"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/gofuzz",
|
"ImportPath": "github.com/google/gofuzz",
|
||||||
|
6
Godeps/_workspace/src/github.com/google/cadvisor/api/handler.go
generated
vendored
6
Godeps/_workspace/src/github.com/google/cadvisor/api/handler.go
generated
vendored
@ -164,11 +164,7 @@ func streamResults(results chan *events.Event, w http.ResponseWriter, r *http.Re
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getContainerInfoRequest(body io.ReadCloser) (*info.ContainerInfoRequest, error) {
|
func getContainerInfoRequest(body io.ReadCloser) (*info.ContainerInfoRequest, error) {
|
||||||
var query info.ContainerInfoRequest
|
query := info.DefaultContainerInfoRequest()
|
||||||
|
|
||||||
// Default stats and samples is 64.
|
|
||||||
query.NumStats = 64
|
|
||||||
|
|
||||||
decoder := json.NewDecoder(body)
|
decoder := json.NewDecoder(body)
|
||||||
err := decoder.Decode(&query)
|
err := decoder.Decode(&query)
|
||||||
if err != nil && err != io.EOF {
|
if err != nil && err != io.EOF {
|
||||||
|
11
Godeps/_workspace/src/github.com/google/cadvisor/info/v1/container.go
generated
vendored
11
Godeps/_workspace/src/github.com/google/cadvisor/info/v1/container.go
generated
vendored
@ -81,7 +81,9 @@ func (self ContainerReferenceSlice) Less(i, j int) bool { return self[i].Name <
|
|||||||
// ContainerInfoQuery is used when users check a container info from the REST api.
|
// ContainerInfoQuery is used when users check a container info from the REST api.
|
||||||
// It specifies how much data users want to get about a container
|
// It specifies how much data users want to get about a container
|
||||||
type ContainerInfoRequest struct {
|
type ContainerInfoRequest struct {
|
||||||
// Max number of stats to return.
|
// Max number of stats to return. Specify -1 for all stats currently available.
|
||||||
|
// If start and end time are specified this limit is ignored.
|
||||||
|
// Default: 60
|
||||||
NumStats int `json:"num_stats,omitempty"`
|
NumStats int `json:"num_stats,omitempty"`
|
||||||
|
|
||||||
// Start time for which to query information.
|
// Start time for which to query information.
|
||||||
@ -93,6 +95,13 @@ type ContainerInfoRequest struct {
|
|||||||
End time.Time `json:"end,omitempty"`
|
End time.Time `json:"end,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns a ContainerInfoRequest with all default values specified.
|
||||||
|
func DefaultContainerInfoRequest() ContainerInfoRequest {
|
||||||
|
return ContainerInfoRequest{
|
||||||
|
NumStats: 60,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (self *ContainerInfoRequest) Equals(other ContainerInfoRequest) bool {
|
func (self *ContainerInfoRequest) Equals(other ContainerInfoRequest) bool {
|
||||||
return self.NumStats == other.NumStats &&
|
return self.NumStats == other.NumStats &&
|
||||||
self.Start.Equal(other.Start) &&
|
self.Start.Equal(other.Start) &&
|
||||||
|
8
Godeps/_workspace/src/github.com/google/cadvisor/storage/memory/stats_buffer.go
generated
vendored
8
Godeps/_workspace/src/github.com/google/cadvisor/storage/memory/stats_buffer.go
generated
vendored
@ -47,13 +47,19 @@ func (self *StatsBuffer) Add(item *info.ContainerStats) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns up to maxResult elements in the specified time period (inclusive).
|
// Returns up to maxResult elements in the specified time period (inclusive).
|
||||||
// Results are from first to last. maxResults of -1 means no limit.
|
// Results are from first to last. maxResults of -1 means no limit. When first
|
||||||
|
// and last are specified, maxResults is ignored.
|
||||||
func (self *StatsBuffer) InTimeRange(start, end time.Time, maxResults int) []*info.ContainerStats {
|
func (self *StatsBuffer) InTimeRange(start, end time.Time, maxResults int) []*info.ContainerStats {
|
||||||
// No stats, return empty.
|
// No stats, return empty.
|
||||||
if self.size == 0 {
|
if self.size == 0 {
|
||||||
return []*info.ContainerStats{}
|
return []*info.ContainerStats{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return all results in a time range if specified.
|
||||||
|
if !start.IsZero() && !end.IsZero() {
|
||||||
|
maxResults = -1
|
||||||
|
}
|
||||||
|
|
||||||
// NOTE: Since we store the elments in descending timestamp order "start" will
|
// NOTE: Since we store the elments in descending timestamp order "start" will
|
||||||
// be a higher index than "end".
|
// be a higher index than "end".
|
||||||
|
|
||||||
|
3
Godeps/_workspace/src/github.com/google/cadvisor/storage/memory/stats_buffer_test.go
generated
vendored
3
Godeps/_workspace/src/github.com/google/cadvisor/storage/memory/stats_buffer_test.go
generated
vendored
@ -161,6 +161,9 @@ func TestInTimeRange(t *testing.T) {
|
|||||||
expectElements(t, sb.InTimeRange(createTime(3), createTime(5), 10), []int32{3, 4})
|
expectElements(t, sb.InTimeRange(createTime(3), createTime(5), 10), []int32{3, 4})
|
||||||
assert.Empty(sb.InTimeRange(createTime(5), createTime(5), 10))
|
assert.Empty(sb.InTimeRange(createTime(5), createTime(5), 10))
|
||||||
|
|
||||||
|
// Start and end time ignores maxResults.
|
||||||
|
expectElements(t, sb.InTimeRange(createTime(1), createTime(5), 1), []int32{1, 2, 3, 4})
|
||||||
|
|
||||||
// No start time.
|
// No start time.
|
||||||
expectElements(t, sb.InTimeRange(empty, createTime(5), 10), []int32{1, 2, 3, 4})
|
expectElements(t, sb.InTimeRange(empty, createTime(5), 10), []int32{1, 2, 3, 4})
|
||||||
expectElements(t, sb.InTimeRange(empty, createTime(4), 10), []int32{1, 2, 3, 4})
|
expectElements(t, sb.InTimeRange(empty, createTime(4), 10), []int32{1, 2, 3, 4})
|
||||||
|
Loading…
Reference in New Issue
Block a user