Merge pull request #6349 from hashicorp/b-host-stats

client: Return empty values when host stats fail
This commit is contained in:
Preetha
2019-11-20 10:13:02 -06:00
committed by GitHub
4 changed files with 23 additions and 15 deletions

View File

@@ -1335,10 +1335,14 @@ func (tr *TaskRunner) emitStats(ru *cstructs.TaskResourceUsage) {
if ru.ResourceUsage.MemoryStats != nil {
tr.setGaugeForMemory(ru)
} else {
tr.logger.Debug("Skipping memory stats for allocation", "reason", "MemoryStats is nil")
}
if ru.ResourceUsage.CpuStats != nil {
tr.setGaugeForCPU(ru)
} else {
tr.logger.Debug("Skipping cpu stats for allocation", "reason", "CpuStats is nil")
}
}