convert chart data from bytes to GiB

This commit is contained in:
Boy132 2024-05-14 10:50:26 +02:00
parent 4e3f919d8e
commit 5f13c15c70
2 changed files with 4 additions and 4 deletions

View File

@ -40,8 +40,8 @@ class NodeMemoryChart extends ChartWidget
/** @var Node $node */ /** @var Node $node */
$node = $this->record; $node = $this->record;
$total = $node->statistics()['memory_total'] ?? 0; $total = ($node->statistics()['memory_total'] ?? 0) / 1024 / 1024 / 1024;
$used = $node->statistics()['memory_used'] ?? 0; $used = ($node->statistics()['memory_used'] ?? 0) / 1024 / 1024 / 1024;
$unused = $total - $used; $unused = $total - $used;
return [ return [

View File

@ -40,8 +40,8 @@ class NodeStorageChart extends ChartWidget
/** @var Node $node */ /** @var Node $node */
$node = $this->record; $node = $this->record;
$total = $node->statistics()['disk_total'] ?? 0; $total = ($node->statistics()['disk_total'] ?? 0) / 1024 / 1024 / 1024;
$used = $node->statistics()['disk_used'] ?? 0; $used = ($node->statistics()['disk_used'] ?? 0) / 1024 / 1024 / 1024;
$unused = $total - $used; $unused = $total - $used;
return [ return [