mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
client_stats: Always emit client stats
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user