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
225f903c
Commit
225f903c
authored
Feb 17, 2016
by
Tim St. Clair
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move stats summary types to a new kubelet/api package to avoid unnecessary dependencies
parent
3616b4bf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
82 deletions
+86
-82
types.go
pkg/kubelet/api/v1alpha1/stats/types.go
+0
-0
fs_resource_analyzer.go
pkg/kubelet/server/stats/fs_resource_analyzer.go
+6
-5
fs_resource_analyzer_test.go
pkg/kubelet/server/stats/fs_resource_analyzer_test.go
+16
-15
summary.go
pkg/kubelet/server/stats/summary.go
+45
-44
summary_test.go
pkg/kubelet/server/stats/summary_test.go
+18
-17
kubelet_test.go
test/e2e_node/kubelet_test.go
+1
-1
No files found.
pkg/kubelet/
server
/stats/types.go
→
pkg/kubelet/
api/v1alpha1
/stats/types.go
View file @
225f903c
File moved
pkg/kubelet/server/stats/fs_resource_analyzer.go
View file @
225f903c
...
@@ -21,6 +21,7 @@ import (
...
@@ -21,6 +21,7 @@ import (
"time"
"time"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/stats"
"k8s.io/kubernetes/pkg/kubelet/metrics"
"k8s.io/kubernetes/pkg/kubelet/metrics"
"k8s.io/kubernetes/pkg/kubelet/util/format"
"k8s.io/kubernetes/pkg/kubelet/util/format"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/types"
...
@@ -36,7 +37,7 @@ type Cache map[types.UID]*PodVolumeStats
...
@@ -36,7 +37,7 @@ type Cache map[types.UID]*PodVolumeStats
// PodVolumeStats encapsulates all VolumeStats for a pod
// PodVolumeStats encapsulates all VolumeStats for a pod
type
PodVolumeStats
struct
{
type
PodVolumeStats
struct
{
Volumes
[]
VolumeStats
Volumes
[]
stats
.
VolumeStats
}
}
// fsResourceAnalyzerInterface is for embedding fs functions into ResourceAnalyzer
// fsResourceAnalyzerInterface is for embedding fs functions into ResourceAnalyzer
...
@@ -107,7 +108,7 @@ func (s *fsResourceAnalyzer) getPodVolumeStats(pod *api.Pod) (PodVolumeStats, bo
...
@@ -107,7 +108,7 @@ func (s *fsResourceAnalyzer) getPodVolumeStats(pod *api.Pod) (PodVolumeStats, bo
}
}
// Call GetMetrics on each Volume and copy the result to a new VolumeStats.FsStats
// Call GetMetrics on each Volume and copy the result to a new VolumeStats.FsStats
stats
:=
make
([]
VolumeStats
,
0
,
len
(
volumes
))
stats
:=
make
([]
stats
.
VolumeStats
,
0
,
len
(
volumes
))
for
name
,
v
:=
range
volumes
{
for
name
,
v
:=
range
volumes
{
metric
,
err
:=
v
.
GetMetrics
()
metric
,
err
:=
v
.
GetMetrics
()
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -123,13 +124,13 @@ func (s *fsResourceAnalyzer) getPodVolumeStats(pod *api.Pod) (PodVolumeStats, bo
...
@@ -123,13 +124,13 @@ func (s *fsResourceAnalyzer) getPodVolumeStats(pod *api.Pod) (PodVolumeStats, bo
return
PodVolumeStats
{
Volumes
:
stats
},
true
return
PodVolumeStats
{
Volumes
:
stats
},
true
}
}
func
(
s
*
fsResourceAnalyzer
)
parsePodVolumeStats
(
podName
string
,
metric
*
volume
.
Metrics
)
VolumeStats
{
func
(
s
*
fsResourceAnalyzer
)
parsePodVolumeStats
(
podName
string
,
metric
*
volume
.
Metrics
)
stats
.
VolumeStats
{
available
:=
uint64
(
metric
.
Available
.
Value
())
available
:=
uint64
(
metric
.
Available
.
Value
())
capacity
:=
uint64
(
metric
.
Capacity
.
Value
())
capacity
:=
uint64
(
metric
.
Capacity
.
Value
())
used
:=
uint64
((
metric
.
Used
.
Value
()))
used
:=
uint64
((
metric
.
Used
.
Value
()))
return
VolumeStats
{
return
stats
.
VolumeStats
{
Name
:
podName
,
Name
:
podName
,
FsStats
:
FsStats
{
FsStats
:
stats
.
FsStats
{
AvailableBytes
:
&
available
,
AvailableBytes
:
&
available
,
CapacityBytes
:
&
capacity
,
CapacityBytes
:
&
capacity
,
UsedBytes
:
&
used
}}
UsedBytes
:
&
used
}}
...
...
pkg/kubelet/server/stats/fs_resource_analyzer_test.go
View file @
225f903c
...
@@ -23,6 +23,7 @@ import (
...
@@ -23,6 +23,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/stats"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume"
...
@@ -32,34 +33,34 @@ import (
...
@@ -32,34 +33,34 @@ import (
// TestGetPodVolumeStats tests that GetPodVolumeStats reads from the cache and returns the value
// TestGetPodVolumeStats tests that GetPodVolumeStats reads from the cache and returns the value
func
TestGetPodVolumeStats
(
t
*
testing
.
T
)
{
func
TestGetPodVolumeStats
(
t
*
testing
.
T
)
{
instance
:=
newFsResourceAnalyzer
(
&
MockStatsProvider
{},
time
.
Minute
*
5
)
instance
:=
newFsResourceAnalyzer
(
&
MockStatsProvider
{},
time
.
Minute
*
5
)
s
tats
,
found
:=
instance
.
GetPodVolumeStats
(
"testpod1"
)
vS
tats
,
found
:=
instance
.
GetPodVolumeStats
(
"testpod1"
)
assert
.
False
(
t
,
found
)
assert
.
False
(
t
,
found
)
assert
.
Equal
(
t
,
PodVolumeStats
{},
s
tats
)
assert
.
Equal
(
t
,
PodVolumeStats
{},
vS
tats
)
instance
.
cachedVolumeStats
.
Store
(
make
(
Cache
))
instance
.
cachedVolumeStats
.
Store
(
make
(
Cache
))
s
tats
,
found
=
instance
.
GetPodVolumeStats
(
"testpod1"
)
vS
tats
,
found
=
instance
.
GetPodVolumeStats
(
"testpod1"
)
assert
.
False
(
t
,
found
)
assert
.
False
(
t
,
found
)
assert
.
Equal
(
t
,
PodVolumeStats
{},
s
tats
)
assert
.
Equal
(
t
,
PodVolumeStats
{},
vS
tats
)
available
:=
uint64
(
100
)
available
:=
uint64
(
100
)
used
:=
uint64
(
200
)
used
:=
uint64
(
200
)
capacity
:=
uint64
(
400
)
capacity
:=
uint64
(
400
)
vs1
:=
VolumeStats
{
vs1
:=
stats
.
VolumeStats
{
Name
:
"vol1"
,
Name
:
"vol1"
,
FsStats
:
FsStats
{
FsStats
:
stats
.
FsStats
{
AvailableBytes
:
&
available
,
AvailableBytes
:
&
available
,
UsedBytes
:
&
used
,
UsedBytes
:
&
used
,
CapacityBytes
:
&
capacity
,
CapacityBytes
:
&
capacity
,
},
},
}
}
pvs
:=
&
PodVolumeStats
{
pvs
:=
&
PodVolumeStats
{
Volumes
:
[]
VolumeStats
{
vs1
},
Volumes
:
[]
stats
.
VolumeStats
{
vs1
},
}
}
instance
.
cachedVolumeStats
.
Load
()
.
(
Cache
)[
"testpod1"
]
=
pvs
instance
.
cachedVolumeStats
.
Load
()
.
(
Cache
)[
"testpod1"
]
=
pvs
s
tats
,
found
=
instance
.
GetPodVolumeStats
(
"testpod1"
)
vS
tats
,
found
=
instance
.
GetPodVolumeStats
(
"testpod1"
)
assert
.
True
(
t
,
found
)
assert
.
True
(
t
,
found
)
assert
.
Equal
(
t
,
*
pvs
,
s
tats
)
assert
.
Equal
(
t
,
*
pvs
,
vS
tats
)
}
}
// TestUpdateCachedPodVolumeStats tests that the cache is updated from the stats provider
// TestUpdateCachedPodVolumeStats tests that the cache is updated from the stats provider
...
@@ -120,9 +121,9 @@ func TestUpdateCachedPodVolumeStats(t *testing.T) {
...
@@ -120,9 +121,9 @@ func TestUpdateCachedPodVolumeStats(t *testing.T) {
v1available
:=
uint64
(
100
)
v1available
:=
uint64
(
100
)
v1used
:=
uint64
(
200
)
v1used
:=
uint64
(
200
)
v1capacity
:=
uint64
(
400
)
v1capacity
:=
uint64
(
400
)
assert
.
Contains
(
t
,
actual1
.
Volumes
,
VolumeStats
{
assert
.
Contains
(
t
,
actual1
.
Volumes
,
stats
.
VolumeStats
{
Name
:
"v1"
,
Name
:
"v1"
,
FsStats
:
FsStats
{
FsStats
:
stats
.
FsStats
{
AvailableBytes
:
&
v1available
,
AvailableBytes
:
&
v1available
,
UsedBytes
:
&
v1used
,
UsedBytes
:
&
v1used
,
CapacityBytes
:
&
v1capacity
,
CapacityBytes
:
&
v1capacity
,
...
@@ -132,9 +133,9 @@ func TestUpdateCachedPodVolumeStats(t *testing.T) {
...
@@ -132,9 +133,9 @@ func TestUpdateCachedPodVolumeStats(t *testing.T) {
v2available
:=
uint64
(
600
)
v2available
:=
uint64
(
600
)
v2used
:=
uint64
(
700
)
v2used
:=
uint64
(
700
)
v2capacity
:=
uint64
(
1400
)
v2capacity
:=
uint64
(
1400
)
assert
.
Contains
(
t
,
actual1
.
Volumes
,
VolumeStats
{
assert
.
Contains
(
t
,
actual1
.
Volumes
,
stats
.
VolumeStats
{
Name
:
"v2"
,
Name
:
"v2"
,
FsStats
:
FsStats
{
FsStats
:
stats
.
FsStats
{
AvailableBytes
:
&
v2available
,
AvailableBytes
:
&
v2available
,
UsedBytes
:
&
v2used
,
UsedBytes
:
&
v2used
,
CapacityBytes
:
&
v2capacity
,
CapacityBytes
:
&
v2capacity
,
...
@@ -147,9 +148,9 @@ func TestUpdateCachedPodVolumeStats(t *testing.T) {
...
@@ -147,9 +148,9 @@ func TestUpdateCachedPodVolumeStats(t *testing.T) {
actual2
,
found
:=
instance
.
GetPodVolumeStats
(
"testpod2"
)
actual2
,
found
:=
instance
.
GetPodVolumeStats
(
"testpod2"
)
assert
.
True
(
t
,
found
)
assert
.
True
(
t
,
found
)
assert
.
Len
(
t
,
actual2
.
Volumes
,
1
)
assert
.
Len
(
t
,
actual2
.
Volumes
,
1
)
assert
.
Contains
(
t
,
actual2
.
Volumes
,
VolumeStats
{
assert
.
Contains
(
t
,
actual2
.
Volumes
,
stats
.
VolumeStats
{
Name
:
"v3"
,
Name
:
"v3"
,
FsStats
:
FsStats
{
FsStats
:
stats
.
FsStats
{
AvailableBytes
:
&
v3available
,
AvailableBytes
:
&
v3available
,
UsedBytes
:
&
v3used
,
UsedBytes
:
&
v3used
,
CapacityBytes
:
&
v3capacity
,
CapacityBytes
:
&
v3capacity
,
...
...
pkg/kubelet/server/stats/summary.go
View file @
225f903c
This diff is collapsed.
Click to expand it.
pkg/kubelet/server/stats/summary_test.go
View file @
225f903c
...
@@ -27,6 +27,7 @@ import (
...
@@ -27,6 +27,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/api/unversioned"
kubestats
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/stats"
"k8s.io/kubernetes/pkg/kubelet/cm"
"k8s.io/kubernetes/pkg/kubelet/cm"
"k8s.io/kubernetes/pkg/kubelet/leaky"
"k8s.io/kubernetes/pkg/kubelet/leaky"
)
)
...
@@ -87,9 +88,9 @@ func TestBuildSummary(t *testing.T) {
...
@@ -87,9 +88,9 @@ func TestBuildSummary(t *testing.T) {
cName20
=
"c1"
// ensure cName20 conflicts with cName01, but is in a different pod + namespace
cName20
=
"c1"
// ensure cName20 conflicts with cName01, but is in a different pod + namespace
)
)
prf0
:=
PodReference
{
Name
:
pName0
,
Namespace
:
namespace0
,
UID
:
"UID"
+
pName0
}
prf0
:=
kubestats
.
PodReference
{
Name
:
pName0
,
Namespace
:
namespace0
,
UID
:
"UID"
+
pName0
}
prf1
:=
PodReference
{
Name
:
pName1
,
Namespace
:
namespace0
,
UID
:
"UID"
+
pName1
}
prf1
:=
kubestats
.
PodReference
{
Name
:
pName1
,
Namespace
:
namespace0
,
UID
:
"UID"
+
pName1
}
prf2
:=
PodReference
{
Name
:
pName2
,
Namespace
:
namespace2
,
UID
:
"UID"
+
pName2
}
prf2
:=
kubestats
.
PodReference
{
Name
:
pName2
,
Namespace
:
namespace2
,
UID
:
"UID"
+
pName2
}
infos
:=
map
[
string
]
v2
.
ContainerInfo
{
infos
:=
map
[
string
]
v2
.
ContainerInfo
{
"/"
:
summaryTestContainerInfo
(
seedRoot
,
""
,
""
,
""
),
"/"
:
summaryTestContainerInfo
(
seedRoot
,
""
,
""
,
""
),
"/docker-daemon"
:
summaryTestContainerInfo
(
seedRuntime
,
""
,
""
,
""
),
"/docker-daemon"
:
summaryTestContainerInfo
(
seedRuntime
,
""
,
""
,
""
),
...
@@ -123,9 +124,9 @@ func TestBuildSummary(t *testing.T) {
...
@@ -123,9 +124,9 @@ func TestBuildSummary(t *testing.T) {
checkNetworkStats
(
t
,
"Node"
,
seedRoot
,
nodeStats
.
Network
)
checkNetworkStats
(
t
,
"Node"
,
seedRoot
,
nodeStats
.
Network
)
systemSeeds
:=
map
[
string
]
int
{
systemSeeds
:=
map
[
string
]
int
{
SystemContainerRuntime
:
seedRuntime
,
kubestats
.
SystemContainerRuntime
:
seedRuntime
,
SystemContainerKubelet
:
seedKubelet
,
kubestats
.
SystemContainerKubelet
:
seedKubelet
,
SystemContainerMisc
:
seedMisc
,
kubestats
.
SystemContainerMisc
:
seedMisc
,
}
}
for
_
,
sys
:=
range
nodeStats
.
SystemContainers
{
for
_
,
sys
:=
range
nodeStats
.
SystemContainers
{
name
:=
sys
.
Name
name
:=
sys
.
Name
...
@@ -139,7 +140,7 @@ func TestBuildSummary(t *testing.T) {
...
@@ -139,7 +140,7 @@ func TestBuildSummary(t *testing.T) {
}
}
assert
.
Equal
(
t
,
3
,
len
(
summary
.
Pods
))
assert
.
Equal
(
t
,
3
,
len
(
summary
.
Pods
))
indexPods
:=
make
(
map
[
PodReference
]
PodStats
,
len
(
summary
.
Pods
))
indexPods
:=
make
(
map
[
kubestats
.
PodReference
]
kubestats
.
PodStats
,
len
(
summary
.
Pods
))
for
_
,
pod
:=
range
summary
.
Pods
{
for
_
,
pod
:=
range
summary
.
Pods
{
indexPods
[
pod
.
PodRef
]
=
pod
indexPods
[
pod
.
PodRef
]
=
pod
}
}
...
@@ -148,7 +149,7 @@ func TestBuildSummary(t *testing.T) {
...
@@ -148,7 +149,7 @@ func TestBuildSummary(t *testing.T) {
ps
,
found
:=
indexPods
[
prf0
]
ps
,
found
:=
indexPods
[
prf0
]
assert
.
True
(
t
,
found
)
assert
.
True
(
t
,
found
)
assert
.
Len
(
t
,
ps
.
Containers
,
2
)
assert
.
Len
(
t
,
ps
.
Containers
,
2
)
indexCon
:=
make
(
map
[
string
]
ContainerStats
,
len
(
ps
.
Containers
))
indexCon
:=
make
(
map
[
string
]
kubestats
.
ContainerStats
,
len
(
ps
.
Containers
))
for
_
,
con
:=
range
ps
.
Containers
{
for
_
,
con
:=
range
ps
.
Containers
{
indexCon
[
con
.
Name
]
=
con
indexCon
[
con
.
Name
]
=
con
}
}
...
@@ -284,7 +285,7 @@ func testTime(base time.Time, seed int) time.Time {
...
@@ -284,7 +285,7 @@ func testTime(base time.Time, seed int) time.Time {
return
base
.
Add
(
time
.
Duration
(
seed
)
*
time
.
Second
)
return
base
.
Add
(
time
.
Duration
(
seed
)
*
time
.
Second
)
}
}
func
checkNetworkStats
(
t
*
testing
.
T
,
label
string
,
seed
int
,
stats
*
NetworkStats
)
{
func
checkNetworkStats
(
t
*
testing
.
T
,
label
string
,
seed
int
,
stats
*
kubestats
.
NetworkStats
)
{
assert
.
EqualValues
(
t
,
testTime
(
timestamp
,
seed
)
.
Unix
(),
stats
.
Time
.
Time
.
Unix
(),
label
+
".Net.Time"
)
assert
.
EqualValues
(
t
,
testTime
(
timestamp
,
seed
)
.
Unix
(),
stats
.
Time
.
Time
.
Unix
(),
label
+
".Net.Time"
)
assert
.
EqualValues
(
t
,
seed
+
offsetNetRxBytes
,
*
stats
.
RxBytes
,
label
+
".Net.RxBytes"
)
assert
.
EqualValues
(
t
,
seed
+
offsetNetRxBytes
,
*
stats
.
RxBytes
,
label
+
".Net.RxBytes"
)
assert
.
EqualValues
(
t
,
seed
+
offsetNetRxErrors
,
*
stats
.
RxErrors
,
label
+
".Net.RxErrors"
)
assert
.
EqualValues
(
t
,
seed
+
offsetNetRxErrors
,
*
stats
.
RxErrors
,
label
+
".Net.RxErrors"
)
...
@@ -292,13 +293,13 @@ func checkNetworkStats(t *testing.T, label string, seed int, stats *NetworkStats
...
@@ -292,13 +293,13 @@ func checkNetworkStats(t *testing.T, label string, seed int, stats *NetworkStats
assert
.
EqualValues
(
t
,
seed
+
offsetNetTxErrors
,
*
stats
.
TxErrors
,
label
+
".Net.TxErrors"
)
assert
.
EqualValues
(
t
,
seed
+
offsetNetTxErrors
,
*
stats
.
TxErrors
,
label
+
".Net.TxErrors"
)
}
}
func
checkCPUStats
(
t
*
testing
.
T
,
label
string
,
seed
int
,
stats
*
CPUStats
)
{
func
checkCPUStats
(
t
*
testing
.
T
,
label
string
,
seed
int
,
stats
*
kubestats
.
CPUStats
)
{
assert
.
EqualValues
(
t
,
testTime
(
timestamp
,
seed
)
.
Unix
(),
stats
.
Time
.
Time
.
Unix
(),
label
+
".CPU.Time"
)
assert
.
EqualValues
(
t
,
testTime
(
timestamp
,
seed
)
.
Unix
(),
stats
.
Time
.
Time
.
Unix
(),
label
+
".CPU.Time"
)
assert
.
EqualValues
(
t
,
seed
+
offsetCPUUsageCores
,
*
stats
.
UsageNanoCores
,
label
+
".CPU.UsageCores"
)
assert
.
EqualValues
(
t
,
seed
+
offsetCPUUsageCores
,
*
stats
.
UsageNanoCores
,
label
+
".CPU.UsageCores"
)
assert
.
EqualValues
(
t
,
seed
+
offsetCPUUsageCoreSeconds
,
*
stats
.
UsageCoreNanoSeconds
,
label
+
".CPU.UsageCoreSeconds"
)
assert
.
EqualValues
(
t
,
seed
+
offsetCPUUsageCoreSeconds
,
*
stats
.
UsageCoreNanoSeconds
,
label
+
".CPU.UsageCoreSeconds"
)
}
}
func
checkMemoryStats
(
t
*
testing
.
T
,
label
string
,
seed
int
,
stats
*
MemoryStats
)
{
func
checkMemoryStats
(
t
*
testing
.
T
,
label
string
,
seed
int
,
stats
*
kubestats
.
MemoryStats
)
{
assert
.
EqualValues
(
t
,
testTime
(
timestamp
,
seed
)
.
Unix
(),
stats
.
Time
.
Time
.
Unix
(),
label
+
".Mem.Time"
)
assert
.
EqualValues
(
t
,
testTime
(
timestamp
,
seed
)
.
Unix
(),
stats
.
Time
.
Time
.
Unix
(),
label
+
".Mem.Time"
)
assert
.
EqualValues
(
t
,
seed
+
offsetMemUsageBytes
,
*
stats
.
UsageBytes
,
label
+
".Mem.UsageBytes"
)
assert
.
EqualValues
(
t
,
seed
+
offsetMemUsageBytes
,
*
stats
.
UsageBytes
,
label
+
".Mem.UsageBytes"
)
assert
.
EqualValues
(
t
,
seed
+
offsetMemWorkingSetBytes
,
*
stats
.
WorkingSetBytes
,
label
+
".Mem.WorkingSetBytes"
)
assert
.
EqualValues
(
t
,
seed
+
offsetMemWorkingSetBytes
,
*
stats
.
WorkingSetBytes
,
label
+
".Mem.WorkingSetBytes"
)
...
@@ -357,19 +358,19 @@ func TestCustomMetrics(t *testing.T) {
...
@@ -357,19 +358,19 @@ func TestCustomMetrics(t *testing.T) {
}
}
sb
:=
&
summaryBuilder
{}
sb
:=
&
summaryBuilder
{}
assert
.
Contains
(
t
,
sb
.
containerInfoV2ToUserDefinedMetrics
(
&
cInfo
),
assert
.
Contains
(
t
,
sb
.
containerInfoV2ToUserDefinedMetrics
(
&
cInfo
),
UserDefinedMetric
{
kubestats
.
UserDefinedMetric
{
UserDefinedMetricDescriptor
:
UserDefinedMetricDescriptor
{
UserDefinedMetricDescriptor
:
kubestats
.
UserDefinedMetricDescriptor
{
Name
:
"qos"
,
Name
:
"qos"
,
Type
:
MetricGauge
,
Type
:
kubestats
.
MetricGauge
,
Units
:
"per second"
,
Units
:
"per second"
,
},
},
Time
:
unversioned
.
NewTime
(
timestamp2
),
Time
:
unversioned
.
NewTime
(
timestamp2
),
Value
:
100
,
Value
:
100
,
},
},
UserDefinedMetric
{
kubestats
.
UserDefinedMetric
{
UserDefinedMetricDescriptor
:
UserDefinedMetricDescriptor
{
UserDefinedMetricDescriptor
:
kubestats
.
UserDefinedMetricDescriptor
{
Name
:
"cpuLoad"
,
Name
:
"cpuLoad"
,
Type
:
MetricCumulative
,
Type
:
kubestats
.
MetricCumulative
,
Units
:
"count"
,
Units
:
"count"
,
},
},
Time
:
unversioned
.
NewTime
(
timestamp2
),
Time
:
unversioned
.
NewTime
(
timestamp2
),
...
...
test/e2e_node/kubelet_test.go
View file @
225f903c
...
@@ -27,7 +27,7 @@ import (
...
@@ -27,7 +27,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
client
"k8s.io/kubernetes/pkg/client/unversioned"
client
"k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/kubelet/
server
/stats"
"k8s.io/kubernetes/pkg/kubelet/
api/v1alpha1
/stats"
"github.com/davecgh/go-spew/spew"
"github.com/davecgh/go-spew/spew"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/ginkgo"
...
...
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