2022-06-22 11:20:57 +02:00
|
|
|
<script>
|
|
|
|
export let host
|
|
|
|
export let metric
|
|
|
|
export let scope
|
|
|
|
export let jobMetrics
|
|
|
|
|
2023-08-09 16:34:00 +02:00
|
|
|
function compareIds(a, b) {
|
|
|
|
return a.id - b.id;
|
|
|
|
}
|
|
|
|
|
2022-06-22 11:20:57 +02:00
|
|
|
$: series = jobMetrics
|
2023-03-30 15:21:35 +02:00
|
|
|
.find(jm => jm.name == metric && jm.scope == scope)
|
2022-06-22 11:20:57 +02:00
|
|
|
?.metric.series.filter(s => s.hostname == host && s.statistics != null)
|
2023-08-09 16:34:00 +02:00
|
|
|
?.sort(compareIds)
|
2022-06-22 11:20:57 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
{#if series == null || series.length == 0}
|
|
|
|
<td colspan={scope == 'node' ? 3 : 4}><i>No data</i></td>
|
|
|
|
{:else if series.length == 1 && scope == 'node'}
|
|
|
|
<td>
|
|
|
|
{series[0].statistics.min}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{series[0].statistics.avg}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{series[0].statistics.max}
|
|
|
|
</td>
|
|
|
|
{:else}
|
|
|
|
<td colspan="4">
|
|
|
|
<table style="width: 100%;">
|
|
|
|
{#each series as s, i}
|
|
|
|
<tr>
|
|
|
|
<th>{s.id ?? i}</th>
|
|
|
|
<td>{s.statistics.min}</td>
|
|
|
|
<td>{s.statistics.avg}</td>
|
|
|
|
<td>{s.statistics.max}</td>
|
|
|
|
</tr>
|
|
|
|
{/each}
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
{/if}
|