Add hugepages draw

This commit is contained in:
2025-12-30 14:36:41 +00:00
parent 0470e8aecb
commit d483a74582
6 changed files with 42 additions and 5 deletions
+5 -2
View File
@@ -93,9 +93,11 @@ namespace display::ui::hostblock
SECTION_GAP;
// ===== Memory bar =====
float memValue, swapValue = 0.0f;
float memValue, swapValue = 0.0f, hugepagesValue = 0.0f;
if (metrics.memory.memory.total > 0)
memValue = static_cast<float>(metrics.memory.memory.used) / static_cast<float>(metrics.memory.memory.total);
if (metrics.memory.hugepages.total > 0)
hugepagesValue = static_cast<float>(metrics.memory.hugepages.total) / static_cast<float>(metrics.memory.memory.total);
memBar.draw(
fb,
@@ -114,13 +116,14 @@ namespace display::ui::hostblock
if (metrics.memory.swap.total > 0)
{
swapValue = metrics.memory.swap.used / metrics.memory.swap.total;
swapValue = static_cast<float>(metrics.memory.swap.used) / static_cast<float>(metrics.memory.swap.total);
memBar.draw(
fb,
x + PADDING,
cursorY,
std::clamp(swapValue, 0.0f, 1.0f));
text.drawTextOutlined(fb,
x + MEM_BAR_TEXT_PADDING_X,
cursorY + 8,