ENH use sensical scales for plots

This commit is contained in:
Nathan Dwarshuis 2021-07-13 22:54:41 -04:00
parent 06647937a8
commit 6218bbd73a
5 changed files with 25 additions and 13 deletions

2
core

@ -1 +1 @@
Subproject commit 59944cce6d8d92f47ef939b0a4d9629dd92cbd11 Subproject commit 94997a4f2e41b254a47e423da793581e1a55c3bd

View File

@ -197,9 +197,11 @@ end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- scaled plot -- scaled plot
M.base_2_scale_data = _G_Widget_.scale_data(2, 0, 0.9) M.base_2_scale_data = function(m)
return _G_Widget_.scale_data(2, m, 0.9)
end
M.initThemedScalePlot = function(x, y, w, h, f) M.initThemedScalePlot = function(x, y, w, h, f, min_domain)
return _G_Widget_.ScalePlot( return _G_Widget_.ScalePlot(
_G_Widget_.make_box(x, y, w, h), _G_Widget_.make_box(x, y, w, h),
1 / _G_INIT_DATA_.UPDATE_INTERVAL, 1 / _G_INIT_DATA_.UPDATE_INTERVAL,
@ -209,14 +211,15 @@ M.initThemedScalePlot = function(x, y, w, h, f)
M.label_font_spec, M.label_font_spec,
f f
), ),
M.base_2_scale_data M.base_2_scale_data(min_domain)
) )
end end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- scaled plot (with textual data above it) -- scaled plot (with textual data above it)
M.initLabeledScalePlot = function(x, y, w, h, format_fun, label_fun, spacing, label) M.initLabeledScalePlot = function(x, y, w, h, format_fun, label_fun, spacing,
label, min_domain)
return { return {
label = _left_text(_G_Widget_.make_point(x, y), label), label = _left_text(_G_Widget_.make_point(x, y), label),
value = _G_Widget_.formatted_text( value = _G_Widget_.formatted_text(
@ -225,7 +228,7 @@ M.initLabeledScalePlot = function(x, y, w, h, format_fun, label_fun, spacing, la
M.right_text_style, M.right_text_style,
format_fun format_fun
), ),
plot = M.initThemedScalePlot(x, y + spacing, w, h, label_fun), plot = M.initThemedScalePlot(x, y + spacing, w, h, label_fun, min_domain),
} }
end end

View File

@ -34,7 +34,8 @@ local dnload = Common.initLabeledScalePlot(
value_format_function, value_format_function,
network_label_function, network_label_function,
_PLOT_SEC_BREAK_, _PLOT_SEC_BREAK_,
'Download' 'Download',
2
) )
local upload = Common.initLabeledScalePlot( local upload = Common.initLabeledScalePlot(
@ -45,7 +46,8 @@ local upload = Common.initLabeledScalePlot(
value_format_function, value_format_function,
network_label_function, network_label_function,
_PLOT_SEC_BREAK_, _PLOT_SEC_BREAK_,
'Upload' 'Upload',
2
) )
local interface_counters_tbl = {} local interface_counters_tbl = {}

View File

@ -45,7 +45,8 @@ local pkg0 = Common.initLabeledScalePlot(
power_format_function, power_format_function,
power_label_function, power_label_function,
_PLOT_SEC_BREAK_, _PLOT_SEC_BREAK_,
'PKG0' 'PKG0',
0
) )
local _CORE_Y_ = header.bottom_y + _TEXT_SPACING_ + _PLOT_SEC_BREAK_ + _PLOT_HEIGHT_ local _CORE_Y_ = header.bottom_y + _TEXT_SPACING_ + _PLOT_SEC_BREAK_ + _PLOT_HEIGHT_
@ -58,7 +59,8 @@ local dram = Common.initLabeledScalePlot(
power_format_function, power_format_function,
power_label_function, power_label_function,
_PLOT_SEC_BREAK_, _PLOT_SEC_BREAK_,
'DRAM' 'DRAM',
0
) )
dram.value.append_end = ' W' dram.value.append_end = ' W'
@ -70,7 +72,8 @@ local battery_draw = Common.initLabeledScalePlot(
ac_format_function, ac_format_function,
power_label_function, power_label_function,
_PLOT_SEC_BREAK_, _PLOT_SEC_BREAK_,
'Battery Draw' 'Battery Draw',
0
) )
local PKG0_PATH = '/sys/class/powercap/intel-rapl:0/energy_uj' local PKG0_PATH = '/sys/class/powercap/intel-rapl:0/energy_uj'

View File

@ -65,7 +65,9 @@ local reads = Common.initLabeledScalePlot(
format_value_function, format_value_function,
io_label_function, io_label_function,
_PLOT_SEC_BREAK_, _PLOT_SEC_BREAK_,
'Reads' 'Reads',
2
) )
local writes = Common.initLabeledScalePlot( local writes = Common.initLabeledScalePlot(
@ -76,9 +78,11 @@ local writes = Common.initLabeledScalePlot(
format_value_function, format_value_function,
io_label_function, io_label_function,
_PLOT_SEC_BREAK_, _PLOT_SEC_BREAK_,
'Writes' 'Writes',
2
) )
_PLOT_SEC_BREAK_ = nil _PLOT_SEC_BREAK_ = nil
_PLOT_HEIGHT_ = nil _PLOT_HEIGHT_ = nil