mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #21370 from gmarek/gather
Fix bug in resource gatherer and add logging to help debug if it doesn't help
This commit is contained in:
commit
041d6bc775
@ -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{}
|
||||
|
Loading…
Reference in New Issue
Block a user