ENH reformat cache/swap values

This commit is contained in:
Nathan Dwarshuis 2021-07-19 01:34:03 -04:00
parent 60157ab71a
commit c771bdab46
3 changed files with 10 additions and 15 deletions

2
core

@ -1 +1 @@
Subproject commit 5d077e82cf855a441d664b0c5968db2c56de5b96 Subproject commit 386b543405c8932045500bef836adea5d8f5abae

View File

@ -510,7 +510,8 @@ M.initTextRows_color = function(x, y, w, spacing, labels, color, format)
#labels, #labels,
_text_row_style('right', color), _text_row_style('right', color),
format, format,
spacing spacing,
0
) )
} }
end end

View File

@ -76,7 +76,7 @@ return function(update_freq)
SWAP_BUFFERS_WIDTH, SWAP_BUFFERS_WIDTH,
TEXT_SPACING, TEXT_SPACING,
{'Page Cache', 'Buffers', 'Kernel Slab'}, {'Page Cache', 'Buffers', 'Kernel Slab'},
'%s%%' '%.1f%%'
) )
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
@ -135,19 +135,13 @@ return function(update_freq)
Dial.set(dial, used_percent) Dial.set(dial, used_percent)
Common.text_ring_set(text_ring, cr, Util.round_to_string(used_percent * 100)) Common.text_ring_set(text_ring, cr, Util.round_to_string(used_percent * 100))
Common.text_row_crit_set(swap, cr, Common.text_row_crit_set(
Util.precision_round_to_string( swap, cr, (swap_total_kb - swap_free_kb) / swap_total_kb * 100
(swap_total_kb - swap_free_kb) )
/ swap_total_kb * 100))
Common.text_rows_set(cache, cr, 1, Util.precision_round_to_string( Common.text_rows_set(cache, cr, 1, cached_kb / mem_total_kb * 100)
cached_kb / mem_total_kb * 100)) Common.text_rows_set(cache, cr, 2, buffers_kb / mem_total_kb * 100)
Common.text_rows_set(cache, cr, 3, slab_reclaimable_kb / mem_total_kb * 100)
Common.text_rows_set(cache, cr, 2, Util.precision_round_to_string(
buffers_kb / mem_total_kb * 100))
Common.text_rows_set(cache, cr, 3, Util.precision_round_to_string(
slab_reclaimable_kb / mem_total_kb * 100))
Timeseries.update(plot, used_percent) Timeseries.update(plot, used_percent)