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
fce28995
Commit
fce28995
authored
Nov 17, 2017
by
Shyam Jeedigunta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Control logs verbosity in resource gatherer
parent
ad750b60
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
framework.go
test/e2e/framework/framework.go
+1
-0
resource_usage_gatherer.go
test/e2e/framework/resource_usage_gatherer.go
+7
-1
nvidia-gpus.go
test/e2e/scheduling/nvidia-gpus.go
+1
-1
No files found.
test/e2e/framework/framework.go
View file @
fce28995
...
...
@@ -207,6 +207,7 @@ func (f *Framework) BeforeEach() {
MasterOnly
:
TestContext
.
GatherKubeSystemResourceUsageData
==
"master"
,
ResourceDataGatheringPeriod
:
60
*
time
.
Second
,
ProbeDuration
:
15
*
time
.
Second
,
PrintVerboseLogs
:
false
,
},
nil
)
if
err
!=
nil
{
Logf
(
"Error while creating NewResourceUsageGatherer: %v"
,
err
)
...
...
test/e2e/framework/resource_usage_gatherer.go
View file @
fce28995
...
...
@@ -137,6 +137,7 @@ type resourceGatherWorker struct {
inKubemark
bool
resourceDataGatheringPeriod
time
.
Duration
probeDuration
time
.
Duration
printVerboseLogs
bool
}
func
(
w
*
resourceGatherWorker
)
singleProbe
()
{
...
...
@@ -161,7 +162,9 @@ func (w *resourceGatherWorker) singleProbe() {
}
for
k
,
v
:=
range
nodeUsage
{
data
[
k
]
=
v
Logf
(
"Get container %v usage on node %v. CPUUsageInCores: %v, MemoryUsageInBytes: %v, MemoryWorkingSetInBytes: %v"
,
k
,
w
.
nodeName
,
v
.
CPUUsageInCores
,
v
.
MemoryUsageInBytes
,
v
.
MemoryWorkingSetInBytes
)
if
w
.
printVerboseLogs
{
Logf
(
"Get container %v usage on node %v. CPUUsageInCores: %v, MemoryUsageInBytes: %v, MemoryWorkingSetInBytes: %v"
,
k
,
w
.
nodeName
,
v
.
CPUUsageInCores
,
v
.
MemoryUsageInBytes
,
v
.
MemoryWorkingSetInBytes
)
}
}
}
w
.
dataSeries
=
append
(
w
.
dataSeries
,
data
)
...
...
@@ -202,6 +205,7 @@ type ResourceGathererOptions struct {
MasterOnly
bool
ResourceDataGatheringPeriod
time
.
Duration
ProbeDuration
time
.
Duration
PrintVerboseLogs
bool
}
func
NewResourceUsageGatherer
(
c
clientset
.
Interface
,
options
ResourceGathererOptions
,
pods
*
v1
.
PodList
)
(
*
containerResourceGatherer
,
error
)
{
...
...
@@ -221,6 +225,7 @@ func NewResourceUsageGatherer(c clientset.Interface, options ResourceGathererOpt
finished
:
false
,
resourceDataGatheringPeriod
:
options
.
ResourceDataGatheringPeriod
,
probeDuration
:
options
.
ProbeDuration
,
printVerboseLogs
:
options
.
PrintVerboseLogs
,
})
}
else
{
// Tracks kube-system pods if no valid PodList is passed in.
...
...
@@ -259,6 +264,7 @@ func NewResourceUsageGatherer(c clientset.Interface, options ResourceGathererOpt
inKubemark
:
false
,
resourceDataGatheringPeriod
:
options
.
ResourceDataGatheringPeriod
,
probeDuration
:
options
.
ProbeDuration
,
printVerboseLogs
:
options
.
PrintVerboseLogs
,
})
if
options
.
MasterOnly
{
break
...
...
test/e2e/scheduling/nvidia-gpus.go
View file @
fce28995
...
...
@@ -184,7 +184,7 @@ func testNvidiaGPUsOnCOS(f *framework.Framework) {
pods
,
err
:=
framework
.
WaitForControlledPods
(
f
.
ClientSet
,
ds
.
Namespace
,
ds
.
Name
,
extensionsinternal
.
Kind
(
"DaemonSet"
))
framework
.
ExpectNoError
(
err
,
"getting pods controlled by the daemonset"
)
framework
.
Logf
(
"Starting ResourceUsageGather for the created DaemonSet pods."
)
rsgather
,
err
:=
framework
.
NewResourceUsageGatherer
(
f
.
ClientSet
,
framework
.
ResourceGathererOptions
{
false
,
false
,
2
*
time
.
Second
,
2
*
time
.
Second
},
pods
)
rsgather
,
err
:=
framework
.
NewResourceUsageGatherer
(
f
.
ClientSet
,
framework
.
ResourceGathererOptions
{
false
,
false
,
2
*
time
.
Second
,
2
*
time
.
Second
,
true
},
pods
)
framework
.
ExpectNoError
(
err
,
"creating ResourceUsageGather for the daemonset pods"
)
go
rsgather
.
StartGatheringData
()
...
...
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