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
5cba1d98
Commit
5cba1d98
authored
Sep 30, 2016
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix kubelet perf data to make work again for perfdash.
parent
918e99e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
perf_util.go
test/e2e/framework/perf_util.go
+5
-3
No files found.
test/e2e/framework/perf_util.go
View file @
5cba1d98
...
@@ -52,7 +52,7 @@ func ApiCallToPerfData(apicalls APIResponsiveness) *perftype.PerfData {
...
@@ -52,7 +52,7 @@ func ApiCallToPerfData(apicalls APIResponsiveness) *perftype.PerfData {
// currentKubeletPerfMetricsVersion is the current kubelet performance metrics version. We should
// currentKubeletPerfMetricsVersion is the current kubelet performance metrics version. We should
// bump up the version each time we make incompatible change to the metrics.
// bump up the version each time we make incompatible change to the metrics.
const
currentKubeletPerfMetricsVersion
=
"v
1
"
const
currentKubeletPerfMetricsVersion
=
"v
2
"
// ResourceUsageToPerfData transforms ResourceUsagePerNode to PerfData. Notice that this function
// ResourceUsageToPerfData transforms ResourceUsagePerNode to PerfData. Notice that this function
// only cares about memory usage, because cpu usage information will be extracted from NodesCPUSummary.
// only cares about memory usage, because cpu usage information will be extracted from NodesCPUSummary.
...
@@ -78,7 +78,7 @@ func PrintPerfData(p *perftype.PerfData) {
...
@@ -78,7 +78,7 @@ func PrintPerfData(p *perftype.PerfData) {
// Notice that this function only cares about memory usage, because cpu usage information will be extracted from NodesCPUSummary.
// Notice that this function only cares about memory usage, because cpu usage information will be extracted from NodesCPUSummary.
func
ResourceUsageToPerfDataWithLabels
(
usagePerNode
ResourceUsagePerNode
,
labels
map
[
string
]
string
)
*
perftype
.
PerfData
{
func
ResourceUsageToPerfDataWithLabels
(
usagePerNode
ResourceUsagePerNode
,
labels
map
[
string
]
string
)
*
perftype
.
PerfData
{
items
:=
[]
perftype
.
DataItem
{}
items
:=
[]
perftype
.
DataItem
{}
for
_
,
usages
:=
range
usagePerNode
{
for
node
,
usages
:=
range
usagePerNode
{
for
c
,
usage
:=
range
usages
{
for
c
,
usage
:=
range
usages
{
item
:=
perftype
.
DataItem
{
item
:=
perftype
.
DataItem
{
Data
:
map
[
string
]
float64
{
Data
:
map
[
string
]
float64
{
...
@@ -88,6 +88,7 @@ func ResourceUsageToPerfDataWithLabels(usagePerNode ResourceUsagePerNode, labels
...
@@ -88,6 +88,7 @@ func ResourceUsageToPerfDataWithLabels(usagePerNode ResourceUsagePerNode, labels
},
},
Unit
:
"MB"
,
Unit
:
"MB"
,
Labels
:
map
[
string
]
string
{
Labels
:
map
[
string
]
string
{
"node"
:
node
,
"container"
:
c
,
"container"
:
c
,
"datatype"
:
"resource"
,
"datatype"
:
"resource"
,
"resource"
:
"memory"
,
"resource"
:
"memory"
,
...
@@ -106,7 +107,7 @@ func ResourceUsageToPerfDataWithLabels(usagePerNode ResourceUsagePerNode, labels
...
@@ -106,7 +107,7 @@ func ResourceUsageToPerfDataWithLabels(usagePerNode ResourceUsagePerNode, labels
// CPUUsageToPerfDataWithLabels transforms NodesCPUSummary to PerfData with additional labels.
// CPUUsageToPerfDataWithLabels transforms NodesCPUSummary to PerfData with additional labels.
func
CPUUsageToPerfDataWithLabels
(
usagePerNode
NodesCPUSummary
,
labels
map
[
string
]
string
)
*
perftype
.
PerfData
{
func
CPUUsageToPerfDataWithLabels
(
usagePerNode
NodesCPUSummary
,
labels
map
[
string
]
string
)
*
perftype
.
PerfData
{
items
:=
[]
perftype
.
DataItem
{}
items
:=
[]
perftype
.
DataItem
{}
for
_
,
usages
:=
range
usagePerNode
{
for
node
,
usages
:=
range
usagePerNode
{
for
c
,
usage
:=
range
usages
{
for
c
,
usage
:=
range
usages
{
data
:=
map
[
string
]
float64
{}
data
:=
map
[
string
]
float64
{}
for
perc
,
value
:=
range
usage
{
for
perc
,
value
:=
range
usage
{
...
@@ -117,6 +118,7 @@ func CPUUsageToPerfDataWithLabels(usagePerNode NodesCPUSummary, labels map[strin
...
@@ -117,6 +118,7 @@ func CPUUsageToPerfDataWithLabels(usagePerNode NodesCPUSummary, labels map[strin
Data
:
data
,
Data
:
data
,
Unit
:
"mCPU"
,
Unit
:
"mCPU"
,
Labels
:
map
[
string
]
string
{
Labels
:
map
[
string
]
string
{
"node"
:
node
,
"container"
:
c
,
"container"
:
c
,
"datatype"
:
"resource"
,
"datatype"
:
"resource"
,
"resource"
:
"cpu"
,
"resource"
:
"cpu"
,
...
...
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