Mark shared metrics on shared jobs

- show [shared] in plots in JobList
- other plot locations Todo
- Relates to issue #107
This commit is contained in:
Christoph Kluge 2023-04-28 12:30:46 +02:00
parent a8980c7a5e
commit e9301a5d39
2 changed files with 10 additions and 4 deletions

View File

@ -128,7 +128,8 @@
statisticsSeries={metric.data.metric.statisticsSeries}
metric={metric.data.name}
cluster={cluster}
subCluster={job.subCluster} />
subCluster={job.subCluster}
isShared={(job.exclusive != 1)}/>
{:else if metric.removed == true && metric.data == null}
<Card body color="info">Metric disabled for subcluster '{ job.subCluster }'</Card>
{:else}

View File

@ -35,6 +35,7 @@
export let metric
export let useStatsSeries = null
export let scope = 'node'
export let isShared = false
if (useStatsSeries == null)
useStatsSeries = statisticsSeries != null
@ -142,13 +143,17 @@
hooks: {
draw: [(u) => {
// Draw plot type label:
let text = `${scope}${plotSeries.length > 2 ? 's' : ''}${
let textl = `${scope}${plotSeries.length > 2 ? 's' : ''}${
useStatsSeries ? ': min/avg/max' : (metricConfig != null && scope != metricConfig.scope ? ` (${metricConfig.aggregation})` : '')}`
let textr = `${(isShared && (scope != 'core' && scope != 'accelerator')) ? '[Shared]' : '' }`
u.ctx.save()
u.ctx.textAlign = 'start' // 'end'
u.ctx.fillStyle = 'black'
u.ctx.fillText(text, u.bbox.left + 10, u.bbox.top + 10)
// u.ctx.fillText(text, u.bbox.left + u.bbox.width - 10, u.bbox.top + u.bbox.height - 10)
u.ctx.fillText(textl, u.bbox.left + 10, u.bbox.top + 10)
u.ctx.textAlign = 'end'
u.ctx.fillStyle = 'black'
u.ctx.fillText(textr, u.bbox.left + u.bbox.width - 10, u.bbox.top + 10)
// u.ctx.fillText(text, u.bbox.left + u.bbox.width - 10, u.bbox.top + u.bbox.height - 10) // Recipe for bottom right
if (!thresholds) {
u.ctx.restore()