Add hugepages draw
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user