We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e6b7a57 commit 52629acCopy full SHA for 52629ac
.changelog/27317.txt
@@ -0,0 +1,3 @@
1
+```release-note:bug
2
+api: only include running tasks in allocation resource usage
3
+```
client/allocrunner/alloc_runner.go
@@ -1314,9 +1314,11 @@ func (ar *allocRunner) LatestAllocStats(taskFilter string) (*cstructs.AllocResou
1314
1315
if usage := tr.LatestResourceUsage(); usage != nil {
1316
astat.Tasks[name] = usage
1317
- astat.ResourceUsage.Add(usage.ResourceUsage)
1318
- if usage.Timestamp > astat.Timestamp {
1319
- astat.Timestamp = usage.Timestamp
+ if tr.IsRunning() {
+ astat.ResourceUsage.Add(usage.ResourceUsage)
+ if usage.Timestamp > astat.Timestamp {
1320
+ astat.Timestamp = usage.Timestamp
1321
+ }
1322
}
1323
1324
0 commit comments