diff --git a/dashboard/src/components/GraphItem.vue b/dashboard/src/components/GraphItem.vue index 95ba3cad1..3fc50ba8f 100644 --- a/dashboard/src/components/GraphItem.vue +++ b/dashboard/src/components/GraphItem.vue @@ -32,14 +32,15 @@ const props = defineProps({ cpu: Object, }); -function createGraphOptions({ yscale, period }) { +function createGraphOptions({ yscale, period, displayLegend }) { const now = Date.now(); return { maintainAspectRatio: false, plugins: { legend: { - display: false + display: displayLegend, + position: 'bottom' }, tooltip: { callbacks: { @@ -202,7 +203,7 @@ function onPeriodChanged() { } // this sets a min 'x' based on current timestamp. so it has to re-created every time the period changes - const graphOptions = createGraphOptions({ yscale, period: props.period }); + const graphOptions = createGraphOptions({ yscale, period: props.period, displayLegend: props.datasetLabels.length > 1 }); if (!graph) { graph = new Chart(graphNode.value, { type: 'line', data, options: graphOptions }); diff --git a/src/metrics.js b/src/metrics.js index 811c0d023..5bf1b6946 100644 --- a/src/metrics.js +++ b/src/metrics.js @@ -355,7 +355,7 @@ async function readSystemFromGraphite(options) { } // CPU: stress --cpu 2 --timeout 60 -// Memory: stress --cpu 2 --timeout 60 +// Memory: stress --vm 2 --vm-bytes 256M async function getSystem(options) { assert.strictEqual(typeof options, 'object');