Commit 2a8c8c2b authored by Phil Renaud's avatar Phil Renaud
Browse files

Index check only using alloc-specific ones too

parent f81faa9c
Showing with 7 additions and 10 deletions
+7 -10
......@@ -103,11 +103,6 @@
<tr data-service-health={{row.model.Status}}>
<td class="name">
<span title={{row.model.Check}}>{{row.model.Check}}</span>
TODO: TEMP
{{format-ts
row.model.Timestamp
}}
</td>
<td class="status">
<span>
......
......@@ -32,9 +32,7 @@ export default class AllocationServiceSidebarComponent extends Component {
}
get aggregateStatus() {
return this.args.service?.mostRecentChecks?.any(
(check) => check.Status === 'failure'
)
return this.checks.any((check) => check.Status === 'failure')
? 'Unhealthy'
: 'Healthy';
}
......@@ -45,7 +43,7 @@ export default class AllocationServiceSidebarComponent extends Component {
// Our UI checks run every 2 seconds; but a check itself may only update every, say, minute.
// Therefore, we'll have duplicate checks in a service's healthChecks array.
// Only get the most recent check for each check.
return this.args.service.healthChecks
return (this.args.service.healthChecks || [])
.filterBy('Alloc', allocID)
.uniqBy('Timestamp')
.sortBy('Timestamp')
......
......@@ -83,11 +83,15 @@ export default class IndexController extends Controller.extend(Sortable) {
return currentServiceName === service.refID;
}
);
// Only append those healthchecks whose timestamps are not already found in service.healthChecks
healthChecks.forEach((check) => {
service.healthChecks.pushObject(check);
});
}
// Contextualize healthchecks for the allocation we're in
service.healthChecks = service.healthChecks.filterBy(
'Alloc',
this.model.id
);
return service;
});
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment