Commit 0180b732 authored by gmarek's avatar gmarek

Fix bug in resource gatherer and add logging to help debug if it doesn't help

parent 3616b4bf
......@@ -87,10 +87,12 @@ func (g *containerResourceGatherer) startGatheringData(c *client.Client, period
now := time.Now()
data, err := g.getKubeSystemContainersResourceUsage(c)
if err != nil {
return err
Logf("Error while getting resource usage: %v", err)
continue
}
g.usageTimeseries[now] = data
case <-g.stopCh:
Logf("Stop channel is closed. Stopping gatherer.")
g.wg.Done()
return nil
}
......@@ -100,8 +102,9 @@ func (g *containerResourceGatherer) startGatheringData(c *client.Client, period
func (g *containerResourceGatherer) stopAndSummarize(percentiles []int, constraints map[string]resourceConstraint) *ResourceUsageSummary {
close(g.stopCh)
g.timer.Stop()
Logf("Closed stop channel.")
g.wg.Wait()
Logf("Waitgroup finished.")
if len(percentiles) == 0 {
Logf("Warning! Empty percentile list for stopAndPrintData.")
return &ResourceUsageSummary{}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment