Skip to content

Commit

Permalink
client_stats: Always emit client stats
Browse files Browse the repository at this point in the history
  • Loading branch information
endocrimes committed Sep 18, 2019
1 parent 9a7dbc8 commit 7ae5048
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 7ae5048

Please sign in to comment.