client_stats: Always emit client stats

This commit is contained in:
Danielle Lancashire
2019-09-19 01:13:14 +02:00
parent 5b183e5306
commit c8ba938e70

View File

@@ -2575,19 +2575,15 @@ func (c *Client) emitStats() {
for {
select {
case <-next.C:
start := time.Now()
err := c.hostStatsCollector.Collect()
next.Reset(c.config.StatsCollectionInterval)
end := time.Now()
duration := end.Sub(start)
if err != nil {
c.logger.Warn("error fetching host resource usage stats", "error", err, "collection_duration", duration)
continue
}
// Publish Node metrics if operator has opted in
if c.config.PublishNodeMetrics {
c.emitHostStats()
c.logger.Warn("error fetching host resource usage stats", "error", err)
} else {
// Publish Node metrics if operator has opted in
if c.config.PublishNodeMetrics {
c.emitHostStats()
}
}
c.emitClientMetrics()