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
0180b732
Commit
0180b732
authored
Feb 17, 2016
by
gmarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug in resource gatherer and add logging to help debug if it doesn't help
parent
3616b4bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
resource_usage_gatherer.go
test/e2e/resource_usage_gatherer.go
+5
-2
No files found.
test/e2e/resource_usage_gatherer.go
View file @
0180b732
...
@@ -87,10 +87,12 @@ func (g *containerResourceGatherer) startGatheringData(c *client.Client, period
...
@@ -87,10 +87,12 @@ func (g *containerResourceGatherer) startGatheringData(c *client.Client, period
now
:=
time
.
Now
()
now
:=
time
.
Now
()
data
,
err
:=
g
.
getKubeSystemContainersResourceUsage
(
c
)
data
,
err
:=
g
.
getKubeSystemContainersResourceUsage
(
c
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
Logf
(
"Error while getting resource usage: %v"
,
err
)
continue
}
}
g
.
usageTimeseries
[
now
]
=
data
g
.
usageTimeseries
[
now
]
=
data
case
<-
g
.
stopCh
:
case
<-
g
.
stopCh
:
Logf
(
"Stop channel is closed. Stopping gatherer."
)
g
.
wg
.
Done
()
g
.
wg
.
Done
()
return
nil
return
nil
}
}
...
@@ -100,8 +102,9 @@ func (g *containerResourceGatherer) startGatheringData(c *client.Client, period
...
@@ -100,8 +102,9 @@ func (g *containerResourceGatherer) startGatheringData(c *client.Client, period
func
(
g
*
containerResourceGatherer
)
stopAndSummarize
(
percentiles
[]
int
,
constraints
map
[
string
]
resourceConstraint
)
*
ResourceUsageSummary
{
func
(
g
*
containerResourceGatherer
)
stopAndSummarize
(
percentiles
[]
int
,
constraints
map
[
string
]
resourceConstraint
)
*
ResourceUsageSummary
{
close
(
g
.
stopCh
)
close
(
g
.
stopCh
)
g
.
timer
.
Stop
(
)
Logf
(
"Closed stop channel."
)
g
.
wg
.
Wait
()
g
.
wg
.
Wait
()
Logf
(
"Waitgroup finished."
)
if
len
(
percentiles
)
==
0
{
if
len
(
percentiles
)
==
0
{
Logf
(
"Warning! Empty percentile list for stopAndPrintData."
)
Logf
(
"Warning! Empty percentile list for stopAndPrintData."
)
return
&
ResourceUsageSummary
{}
return
&
ResourceUsageSummary
{}
...
...
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