metrics: make the memory y-unit scale more flexible
system memory is in GiB. app memory is usually in MiB
This commit is contained in:
@@ -39,7 +39,7 @@ const networkWriteTotal = ref(0);
|
||||
const blockReadTotal = ref(0);
|
||||
const blockWriteTotal = ref(0);
|
||||
|
||||
let systemMemory = {};
|
||||
const appMemory = app.memoryLimit || app.manifest.memoryLimit || 256*1024*1024;
|
||||
let systemCpus = {};
|
||||
let metricStream = null;
|
||||
|
||||
@@ -84,13 +84,7 @@ async function onPeriodChange() {
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
let error, result;
|
||||
[error, result] = await systemModel.memory();
|
||||
if (error) return console.error(error);
|
||||
|
||||
systemMemory = result;
|
||||
|
||||
[error, result] = await systemModel.cpus();
|
||||
const [error, result] = await systemModel.cpus();
|
||||
if (error) return console.error(error);
|
||||
|
||||
systemCpus = result;
|
||||
@@ -124,12 +118,12 @@ onUnmounted(async () => {
|
||||
|
||||
<GraphItem ref="memoryGraphItem"
|
||||
title="Memory"
|
||||
:subtext="`RAM: ${prettyBinarySize(app.memoryLimit || 256*1024*1024)}`"
|
||||
:subtext="`RAM: ${prettyBinarySize(app.memoryLimit || app.manifest.memoryLimit || 256*1024*1024)}`"
|
||||
:period="period"
|
||||
yscale="memory"
|
||||
:dataset-labels="['Memory']"
|
||||
:dataset-colors="['#9ad0f5']"
|
||||
:memory="systemMemory"
|
||||
:memory="appMemory"
|
||||
>
|
||||
</GraphItem>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user