ENH make plot heights/y ticks configurable per modules
This commit is contained in:
parent
fb79ea899d
commit
4b5f289b99
|
@ -11,8 +11,8 @@ let TextGeo = { Type = { text_spacing : Natural }, default.text_spacing = 20 }
|
||||||
let SepGeo = { Type = { sep_spacing : Natural }, default.sep_spacing = 20 }
|
let SepGeo = { Type = { sep_spacing : Natural }, default.sep_spacing = 20 }
|
||||||
|
|
||||||
let PlotGeo_ =
|
let PlotGeo_ =
|
||||||
{ Type = { sec_break : Natural, height : Natural }
|
{ Type = { sec_break : Natural, height : Natural, ticks_y : Natural }
|
||||||
, default = { sec_break = 20, height = 56 }
|
, default = { sec_break = 20, height = 56, ticks_y = 4 }
|
||||||
}
|
}
|
||||||
|
|
||||||
let PlotGeo = { Type = { plot : PlotGeo_.Type }, default.plot = PlotGeo_::{=} }
|
let PlotGeo = { Type = { plot : PlotGeo_.Type }, default.plot = PlotGeo_::{=} }
|
||||||
|
@ -156,10 +156,9 @@ let PlotGeometry =
|
||||||
{ spacing : Natural
|
{ spacing : Natural
|
||||||
, height : Natural
|
, height : Natural
|
||||||
, seconds : Natural
|
, seconds : Natural
|
||||||
, ticks : Vector2 Natural
|
, ticks_x : Natural
|
||||||
}
|
}
|
||||||
, default =
|
, default = { seconds = 90, ticks_x = 9, height = 56, spacing = 20 }
|
||||||
{ seconds = 90, ticks = { x = 9, y = 4 }, height = 56, spacing = 20 }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let TableGeometry =
|
let TableGeometry =
|
||||||
|
|
|
@ -103,19 +103,23 @@ return function(config)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
-- timeseries helper functions
|
-- timeseries helper functions
|
||||||
|
|
||||||
local _default_grid_config = timeseries.grid_config(
|
local _default_grid_config = function(ticks_y)
|
||||||
geometry.plot.ticks.x,
|
return timeseries.grid_config(
|
||||||
geometry.plot.ticks.y,
|
geometry.plot.ticks_x,
|
||||||
|
ticks_y,
|
||||||
patterns.plot.grid
|
patterns.plot.grid
|
||||||
)
|
)
|
||||||
|
end
|
||||||
|
|
||||||
local _default_plot_config = timeseries.config(
|
local _default_plot_config = function(ticks_y)
|
||||||
|
return timeseries.config(
|
||||||
geometry.plot.seconds,
|
geometry.plot.seconds,
|
||||||
patterns.plot.outline,
|
patterns.plot.outline,
|
||||||
patterns.plot.data.border,
|
patterns.plot.data.border,
|
||||||
patterns.plot.data.fill,
|
patterns.plot.data.fill,
|
||||||
_default_grid_config
|
_default_grid_config(ticks_y)
|
||||||
)
|
)
|
||||||
|
end
|
||||||
|
|
||||||
local _format_percent_label = function(_)
|
local _format_percent_label = function(_)
|
||||||
return function(z) return __string_format('%i%%', math.floor(z * 100)) end
|
return function(z) return __string_format('%i%%', math.floor(z * 100)) end
|
||||||
|
@ -131,18 +135,20 @@ return function(config)
|
||||||
_format_percent_label
|
_format_percent_label
|
||||||
)
|
)
|
||||||
|
|
||||||
local _make_timeseries = function(x, y, w, h, label_config, update_freq)
|
local _make_timeseries = function(x, y, w, h, ticks_y, label_config, update_freq)
|
||||||
return timeseries.make(
|
return timeseries.make(
|
||||||
geom.make_box(x, y, w, h),
|
geom.make_box(x, y, w, h),
|
||||||
update_freq,
|
update_freq,
|
||||||
_default_plot_config,
|
_default_plot_config(ticks_y),
|
||||||
label_config
|
label_config
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
local gplot = geometry.plot
|
local gplot = geometry.plot
|
||||||
|
|
||||||
local _make_tagged_percent_timeseries = function(x, y, w, h, spacing, label, update_freq, _format)
|
local _make_tagged_percent_timeseries = function(x, y, w, h, ticks_y,
|
||||||
|
spacing, label, update_freq,
|
||||||
|
_format)
|
||||||
return {
|
return {
|
||||||
label = _left_text(geom.make_point(x, y), label),
|
label = _left_text(geom.make_point(x, y), label),
|
||||||
value = text_threshold.make_formatted(
|
value = text_threshold.make_formatted(
|
||||||
|
@ -157,6 +163,7 @@ return function(config)
|
||||||
y + _maybe_config(gplot.spacing, spacing),
|
y + _maybe_config(gplot.spacing, spacing),
|
||||||
w,
|
w,
|
||||||
_maybe_config(gplot.height, h),
|
_maybe_config(gplot.height, h),
|
||||||
|
ticks_y,
|
||||||
update_freq
|
update_freq
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
@ -169,11 +176,11 @@ return function(config)
|
||||||
return scaled_timeseries.scaling_parameters(2, m, 0.9)
|
return scaled_timeseries.scaling_parameters(2, m, 0.9)
|
||||||
end
|
end
|
||||||
|
|
||||||
local _make_scaled_timeseries = function(x, y, w, h, f, min_domain, update_freq)
|
local _make_scaled_timeseries = function(x, y, w, h, ticks_y, f, min_domain, update_freq)
|
||||||
return scaled_timeseries.make(
|
return scaled_timeseries.make(
|
||||||
geom.make_box(x, y, w, h),
|
geom.make_box(x, y, w, h),
|
||||||
update_freq,
|
update_freq,
|
||||||
_default_plot_config,
|
_default_plot_config(ticks_y),
|
||||||
timeseries.label_config(patterns.text.inactive, label_font_spec, f),
|
timeseries.label_config(patterns.text.inactive, label_font_spec, f),
|
||||||
_base_2_scale_data(min_domain)
|
_base_2_scale_data(min_domain)
|
||||||
)
|
)
|
||||||
|
@ -216,22 +223,24 @@ return function(config)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
-- percent timeseries
|
-- percent timeseries
|
||||||
|
|
||||||
M.make_percent_timeseries = function(x, y, w, h, update_freq)
|
M.make_percent_timeseries = function(x, y, w, h, ticks_y, update_freq)
|
||||||
return _make_timeseries(x, y, w, h, _percent_label_config, update_freq)
|
return _make_timeseries(x, y, w, h, ticks_y, _percent_label_config, update_freq)
|
||||||
end
|
end
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
-- tagged percent timeseries
|
-- tagged percent timeseries
|
||||||
|
|
||||||
M.make_tagged_percent_timeseries = function(x, y, w, h, spacing, label, update_freq)
|
M.make_tagged_percent_timeseries = function(x, y, w, h, ticks_y, spacing,
|
||||||
|
label, update_freq)
|
||||||
return _make_tagged_percent_timeseries(
|
return _make_tagged_percent_timeseries(
|
||||||
x, y, w, h, spacing, label, update_freq, '%s%%'
|
x, y, w, h, ticks_y, spacing, label, update_freq, '%s%%'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
M.make_tagged_maybe_percent_timeseries = function(x, y, w, h, spacing, label, update_freq)
|
M.make_tagged_maybe_percent_timeseries = function(x, y, w, h, ticks_y,
|
||||||
|
spacing, label, update_freq)
|
||||||
return _make_tagged_percent_timeseries(
|
return _make_tagged_percent_timeseries(
|
||||||
x, y, w, h, spacing, label, update_freq, _format_percent_maybe
|
x, y, w, h, ticks_y, spacing, label, update_freq, _format_percent_maybe
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -294,9 +303,9 @@ return function(config)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
-- tagged scaled plot
|
-- tagged scaled plot
|
||||||
|
|
||||||
M.make_tagged_scaled_timeseries = function(x, y, w, h, format_fun, label_fun,
|
M.make_tagged_scaled_timeseries = function(x, y, w, h, ticks_y, format_fun,
|
||||||
spacing, label, min_domain,
|
label_fun, spacing, label,
|
||||||
update_freq)
|
min_domain, update_freq)
|
||||||
return {
|
return {
|
||||||
label = _left_text(geom.make_point(x, y), label),
|
label = _left_text(geom.make_point(x, y), label),
|
||||||
value = text.make_formatted(
|
value = text.make_formatted(
|
||||||
|
@ -310,6 +319,7 @@ return function(config)
|
||||||
y + spacing,
|
y + spacing,
|
||||||
w,
|
w,
|
||||||
h,
|
h,
|
||||||
|
ticks_y,
|
||||||
label_fun,
|
label_fun,
|
||||||
min_domain,
|
min_domain,
|
||||||
update_freq
|
update_freq
|
||||||
|
@ -341,8 +351,9 @@ return function(config)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
M.make_rate_timeseries = function(x, y, w, h, format_fun, label_fun, spacing,
|
M.make_rate_timeseries = function(x, y, w, h, ticks_y, format_fun,
|
||||||
label, min_domain, update_freq, init)
|
label_fun, spacing, label, min_domain,
|
||||||
|
update_freq, init)
|
||||||
return {
|
return {
|
||||||
label = _left_text(geom.make_point(x, y), label),
|
label = _left_text(geom.make_point(x, y), label),
|
||||||
value = text.make_formatted(
|
value = text.make_formatted(
|
||||||
|
@ -356,6 +367,7 @@ return function(config)
|
||||||
y + spacing,
|
y + spacing,
|
||||||
w,
|
w,
|
||||||
h,
|
h,
|
||||||
|
ticks_y,
|
||||||
label_fun,
|
label_fun,
|
||||||
min_domain,
|
min_domain,
|
||||||
update_freq
|
update_freq
|
||||||
|
|
|
@ -3,10 +3,10 @@ local i_o = require 'i_o'
|
||||||
|
|
||||||
return function(update_freq, config, common, width, point)
|
return function(update_freq, config, common, width, point)
|
||||||
local geo = config.geometry
|
local geo = config.geometry
|
||||||
local SEPARATOR_SPACING = geo.sep_spacing
|
local sep_spacing = geo.sep_spacing
|
||||||
local TEXT_SPACING = geo.text_spacing
|
local text_spacing = geo.text_spacing
|
||||||
local PLOT_SEC_BREAK = geo.plot.sec_break
|
local plot_sec_break = geo.plot.sec_break
|
||||||
local PLOT_HEIGHT = geo.plot.height
|
local plot_height = geo.plot.height
|
||||||
local NA = 'N/A'
|
local NA = 'N/A'
|
||||||
local NVIDIA_EXE = 'nvidia-settings'
|
local NVIDIA_EXE = 'nvidia-settings'
|
||||||
local __string_match = string.match
|
local __string_match = string.match
|
||||||
|
@ -89,8 +89,9 @@ return function(update_freq, config, common, width, point)
|
||||||
point.x,
|
point.x,
|
||||||
y,
|
y,
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT,
|
plot_height,
|
||||||
PLOT_SEC_BREAK,
|
geo.plot.ticks_y,
|
||||||
|
plot_sec_break,
|
||||||
label,
|
label,
|
||||||
update_freq
|
update_freq
|
||||||
)
|
)
|
||||||
|
@ -103,7 +104,7 @@ return function(update_freq, config, common, width, point)
|
||||||
local dynamic = pure.partial(common.tagged_percent_timeseries_draw_dynamic, obj)
|
local dynamic = pure.partial(common.tagged_percent_timeseries_draw_dynamic, obj)
|
||||||
return common.mk_acc(
|
return common.mk_acc(
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT + PLOT_SEC_BREAK,
|
plot_height + plot_sec_break,
|
||||||
update,
|
update,
|
||||||
static,
|
static,
|
||||||
dynamic
|
dynamic
|
||||||
|
@ -155,7 +156,7 @@ return function(update_freq, config, common, width, point)
|
||||||
point.x,
|
point.x,
|
||||||
y,
|
y,
|
||||||
width,
|
width,
|
||||||
TEXT_SPACING,
|
text_spacing,
|
||||||
{'GPU Clock Speed', 'Memory Clock Speed'}
|
{'GPU Clock Speed', 'Memory Clock Speed'}
|
||||||
)
|
)
|
||||||
local update = function()
|
local update = function()
|
||||||
|
@ -169,7 +170,7 @@ return function(update_freq, config, common, width, point)
|
||||||
end
|
end
|
||||||
local static = pure.partial(common.text_rows_draw_static, obj)
|
local static = pure.partial(common.text_rows_draw_static, obj)
|
||||||
local dynamic = pure.partial(common.text_rows_draw_dynamic, obj)
|
local dynamic = pure.partial(common.text_rows_draw_dynamic, obj)
|
||||||
return common.mk_acc(width, TEXT_SPACING, update, static, dynamic)
|
return common.mk_acc(width, text_spacing, update, static, dynamic)
|
||||||
end
|
end
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
@ -207,19 +208,19 @@ return function(update_freq, config, common, width, point)
|
||||||
point = point,
|
point = point,
|
||||||
width = width,
|
width = width,
|
||||||
set_state = update_state,
|
set_state = update_state,
|
||||||
top = {{mk_status, true, SEPARATOR_SPACING}},
|
top = {{mk_status, true, sep_spacing}},
|
||||||
common.mk_section(
|
common.mk_section(
|
||||||
SEPARATOR_SPACING,
|
sep_spacing,
|
||||||
{mk_temp, config.show_temp, SEPARATOR_SPACING}
|
{mk_temp, config.show_temp, sep_spacing}
|
||||||
),
|
),
|
||||||
common.mk_section(
|
common.mk_section(
|
||||||
SEPARATOR_SPACING,
|
sep_spacing,
|
||||||
{mk_clock, config.show_clock, SEPARATOR_SPACING}
|
{mk_clock, config.show_clock, sep_spacing}
|
||||||
),
|
),
|
||||||
common.mk_section(
|
common.mk_section(
|
||||||
SEPARATOR_SPACING,
|
sep_spacing,
|
||||||
{mk_gpu_util, config.show_gpu_util, PLOT_SEC_BREAK},
|
{mk_gpu_util, config.show_gpu_util, plot_sec_break},
|
||||||
{mk_mem_util, config.show_mem_util, PLOT_SEC_BREAK},
|
{mk_mem_util, config.show_mem_util, plot_sec_break},
|
||||||
{mk_vid_util, config.show_vid_util, 0}
|
{mk_vid_util, config.show_vid_util, 0}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,14 +6,14 @@ local sys = require 'sys'
|
||||||
|
|
||||||
return function(update_freq, config, common, width, point)
|
return function(update_freq, config, common, width, point)
|
||||||
local geo = config.geometry
|
local geo = config.geometry
|
||||||
local DIAL_THICKNESS = 8
|
local dial_thickness = 8
|
||||||
local DIAL_RADIUS = 32
|
local dial_radius = 32
|
||||||
local DIAL_X_SPACING = 40
|
local dial_x_spacing = 40
|
||||||
local CACHE_Y_OFFSET = 7
|
local cache_y_offset = 7
|
||||||
local CACHE_X_OFFSET = 50
|
local cache_x_offset = 50
|
||||||
local PLOT_SECTION_BREAK = geo.plot.sec_break
|
local plot_sec_break = geo.plot.sec_break
|
||||||
local PLOT_HEIGHT = geo.plot.height
|
local plot_height = geo.plot.height
|
||||||
local TABLE_SECTION_BREAK = geo.table.sec_break
|
local table_sec_break = geo.table.sec_break
|
||||||
|
|
||||||
local __math_floor = math.floor
|
local __math_floor = math.floor
|
||||||
local __string_format = string.format
|
local __string_format = string.format
|
||||||
|
@ -49,33 +49,33 @@ return function(update_freq, config, common, width, point)
|
||||||
-- mem stats (dial + text)
|
-- mem stats (dial + text)
|
||||||
|
|
||||||
local mk_stats = function(y)
|
local mk_stats = function(y)
|
||||||
local MEM_X = point.x + DIAL_RADIUS + DIAL_THICKNESS / 2
|
local mem_x = point.x + dial_radius + dial_thickness / 2
|
||||||
local DIAL_DIAMETER = DIAL_RADIUS * 2 + DIAL_THICKNESS
|
local dial_diameter = dial_radius * 2 + dial_thickness
|
||||||
local CACHE_X
|
local cache_x
|
||||||
local SWAP_X
|
local swap_x
|
||||||
if _show_swap == true then
|
if _show_swap == true then
|
||||||
SWAP_X = MEM_X + DIAL_DIAMETER + DIAL_X_SPACING
|
swap_x = mem_x + dial_diameter + dial_x_spacing
|
||||||
CACHE_X = SWAP_X + CACHE_X_OFFSET + DIAL_DIAMETER / 2
|
cache_x = swap_x + cache_x_offset + dial_diameter / 2
|
||||||
else
|
else
|
||||||
CACHE_X = MEM_X + CACHE_X_OFFSET + DIAL_DIAMETER / 2
|
cache_x = mem_x + cache_x_offset + dial_diameter / 2
|
||||||
end
|
end
|
||||||
local CACHE_WIDTH = point.x + width - CACHE_X
|
local cache_width = point.x + width - cache_x
|
||||||
local format_percent = pure.partial(__string_format, '%i%%', true)
|
local format_percent = pure.partial(__string_format, '%i%%', true)
|
||||||
|
|
||||||
-- memory bits (used no matter what)
|
-- memory bits (used no matter what)
|
||||||
local mem = common.make_dial(
|
local mem = common.make_dial(
|
||||||
MEM_X,
|
mem_x,
|
||||||
y + DIAL_RADIUS,
|
y + dial_radius,
|
||||||
DIAL_RADIUS,
|
dial_radius,
|
||||||
DIAL_THICKNESS,
|
dial_thickness,
|
||||||
80,
|
80,
|
||||||
format_percent,
|
format_percent,
|
||||||
__math_floor
|
__math_floor
|
||||||
)
|
)
|
||||||
local cache = common.make_text_rows_formatted(
|
local cache = common.make_text_rows_formatted(
|
||||||
CACHE_X,
|
cache_x,
|
||||||
y + CACHE_Y_OFFSET,
|
y + cache_y_offset,
|
||||||
CACHE_WIDTH,
|
cache_width,
|
||||||
geo.text_spacing,
|
geo.text_spacing,
|
||||||
{'Page Cache', 'Buffers', 'Shared', 'Kernel Slab'},
|
{'Page Cache', 'Buffers', 'Shared', 'Kernel Slab'},
|
||||||
'%.1f%%'
|
'%.1f%%'
|
||||||
|
@ -98,15 +98,15 @@ return function(update_freq, config, common, width, point)
|
||||||
common.dial_draw_dynamic(mem, cr)
|
common.dial_draw_dynamic(mem, cr)
|
||||||
common.text_rows_draw_dynamic(cache, cr)
|
common.text_rows_draw_dynamic(cache, cr)
|
||||||
end
|
end
|
||||||
local ret = pure.partial(common.mk_acc, width, DIAL_DIAMETER)
|
local ret = pure.partial(common.mk_acc, width, dial_diameter)
|
||||||
|
|
||||||
-- add swap bits if needed
|
-- add swap bits if needed
|
||||||
if _show_swap == true then
|
if _show_swap == true then
|
||||||
local swap = common.make_dial(
|
local swap = common.make_dial(
|
||||||
SWAP_X,
|
swap_x,
|
||||||
y + DIAL_RADIUS,
|
y + dial_radius,
|
||||||
DIAL_RADIUS,
|
dial_radius,
|
||||||
DIAL_THICKNESS,
|
dial_thickness,
|
||||||
80,
|
80,
|
||||||
format_percent,
|
format_percent,
|
||||||
__math_floor
|
__math_floor
|
||||||
|
@ -135,12 +135,13 @@ return function(update_freq, config, common, width, point)
|
||||||
point.x,
|
point.x,
|
||||||
y,
|
y,
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT,
|
plot_height,
|
||||||
|
geo.plot.ticks_y,
|
||||||
update_freq
|
update_freq
|
||||||
)
|
)
|
||||||
return common.mk_acc(
|
return common.mk_acc(
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT,
|
plot_height,
|
||||||
function() timeseries.update(obj, mod_state.mem.used_percent) end,
|
function() timeseries.update(obj, mod_state.mem.used_percent) end,
|
||||||
pure.partial(timeseries.draw_static, obj),
|
pure.partial(timeseries.draw_static, obj),
|
||||||
pure.partial(timeseries.draw_dynamic, obj)
|
pure.partial(timeseries.draw_dynamic, obj)
|
||||||
|
@ -152,14 +153,15 @@ return function(update_freq, config, common, width, point)
|
||||||
point.x,
|
point.x,
|
||||||
y,
|
y,
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT,
|
plot_height,
|
||||||
PLOT_SECTION_BREAK,
|
geo.plot.ticks_y,
|
||||||
|
plot_sec_break,
|
||||||
"Total Memory",
|
"Total Memory",
|
||||||
update_freq
|
update_freq
|
||||||
)
|
)
|
||||||
return common.mk_acc(
|
return common.mk_acc(
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT + PLOT_SECTION_BREAK,
|
plot_height + plot_sec_break,
|
||||||
function()
|
function()
|
||||||
common.tagged_percent_timeseries_set(
|
common.tagged_percent_timeseries_set(
|
||||||
obj,
|
obj,
|
||||||
|
@ -216,8 +218,8 @@ return function(update_freq, config, common, width, point)
|
||||||
width = width,
|
width = width,
|
||||||
set_state = read_state,
|
set_state = read_state,
|
||||||
top = {
|
top = {
|
||||||
{mk_stats, config.show_stats, PLOT_SECTION_BREAK},
|
{mk_stats, config.show_stats, plot_sec_break},
|
||||||
{mk_plot, config.show_plot, TABLE_SECTION_BREAK},
|
{mk_plot, config.show_plot, table_sec_break},
|
||||||
{mk_tbl, config.table_rows > 0, 0},
|
{mk_tbl, config.table_rows > 0, 0},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,8 @@ local sys = require 'sys'
|
||||||
|
|
||||||
return function(update_freq, config, common, width, point)
|
return function(update_freq, config, common, width, point)
|
||||||
local geo = config.geometry
|
local geo = config.geometry
|
||||||
local PLOT_SEC_BREAK = geo.plot.sec_break
|
local plot_sec_break = geo.plot.sec_break
|
||||||
local PLOT_HEIGHT = geo.plot.height
|
local plot_height = geo.plot.height
|
||||||
local interface_paths = sys.get_net_interface_paths()
|
local interface_paths = sys.get_net_interface_paths()
|
||||||
|
|
||||||
local get_bits = function(path)
|
local get_bits = function(path)
|
||||||
|
@ -41,10 +41,11 @@ return function(update_freq, config, common, width, point)
|
||||||
point.x,
|
point.x,
|
||||||
y,
|
y,
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT,
|
plot_height,
|
||||||
|
geo.plot.ticks_y,
|
||||||
value_format_function,
|
value_format_function,
|
||||||
common.converted_y_label_format_generator('b'),
|
common.converted_y_label_format_generator('b'),
|
||||||
PLOT_SEC_BREAK,
|
plot_sec_break,
|
||||||
label,
|
label,
|
||||||
2,
|
2,
|
||||||
update_freq,
|
update_freq,
|
||||||
|
@ -52,7 +53,7 @@ return function(update_freq, config, common, width, point)
|
||||||
)
|
)
|
||||||
return common.mk_acc(
|
return common.mk_acc(
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT + PLOT_SEC_BREAK,
|
plot_height + plot_sec_break,
|
||||||
function() common.update_rate_timeseries(obj, mod_state[key]) end,
|
function() common.update_rate_timeseries(obj, mod_state[key]) end,
|
||||||
pure.partial(common.tagged_scaled_timeseries_draw_static, obj),
|
pure.partial(common.tagged_scaled_timeseries_draw_static, obj),
|
||||||
pure.partial(common.tagged_scaled_timeseries_draw_dynamic, obj)
|
pure.partial(common.tagged_scaled_timeseries_draw_dynamic, obj)
|
||||||
|
@ -71,7 +72,7 @@ return function(update_freq, config, common, width, point)
|
||||||
width = width,
|
width = width,
|
||||||
set_state = read_interfaces,
|
set_state = read_interfaces,
|
||||||
top = {
|
top = {
|
||||||
{mk_rx, true, PLOT_SEC_BREAK},
|
{mk_rx, true, plot_sec_break},
|
||||||
{mk_tx, true, 0},
|
{mk_tx, true, 0},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,8 @@ local sys = require 'sys'
|
||||||
|
|
||||||
return function(update_freq, config, common, width, point)
|
return function(update_freq, config, common, width, point)
|
||||||
local geo = config.geometry
|
local geo = config.geometry
|
||||||
local PLOT_SEC_BREAK = geo.plot.sec_break
|
local plot_sec_break = geo.plot.sec_break
|
||||||
local PLOT_HEIGHT = geo.plot.height
|
local plot_height = geo.plot.height
|
||||||
|
|
||||||
local power_label_function = function(plot_max)
|
local power_label_function = function(plot_max)
|
||||||
local fmt = common.y_label_format_string(plot_max, 'W')
|
local fmt = common.y_label_format_string(plot_max, 'W')
|
||||||
|
@ -30,10 +30,11 @@ return function(update_freq, config, common, width, point)
|
||||||
point.x,
|
point.x,
|
||||||
y,
|
y,
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT,
|
plot_height,
|
||||||
|
geo.plot.ticks_y,
|
||||||
format_rapl,
|
format_rapl,
|
||||||
power_label_function,
|
power_label_function,
|
||||||
PLOT_SEC_BREAK,
|
plot_sec_break,
|
||||||
label,
|
label,
|
||||||
0,
|
0,
|
||||||
update_freq,
|
update_freq,
|
||||||
|
@ -41,7 +42,7 @@ return function(update_freq, config, common, width, point)
|
||||||
)
|
)
|
||||||
return common.mk_acc(
|
return common.mk_acc(
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT + PLOT_SEC_BREAK,
|
plot_height + plot_sec_break,
|
||||||
function(_) common.update_rate_timeseries(obj, read_joules()) end,
|
function(_) common.update_rate_timeseries(obj, read_joules()) end,
|
||||||
mk_static(obj),
|
mk_static(obj),
|
||||||
mk_dynamic(obj)
|
mk_dynamic(obj)
|
||||||
|
@ -72,17 +73,18 @@ return function(update_freq, config, common, width, point)
|
||||||
point.x,
|
point.x,
|
||||||
y,
|
y,
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT,
|
plot_height,
|
||||||
|
geo.plot.ticks_y,
|
||||||
format_ac,
|
format_ac,
|
||||||
power_label_function,
|
power_label_function,
|
||||||
PLOT_SEC_BREAK,
|
plot_sec_break,
|
||||||
'Battery Draw',
|
'Battery Draw',
|
||||||
0,
|
0,
|
||||||
update_freq
|
update_freq
|
||||||
)
|
)
|
||||||
return common.mk_acc(
|
return common.mk_acc(
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT + PLOT_SEC_BREAK,
|
plot_height + plot_sec_break,
|
||||||
function()
|
function()
|
||||||
common.tagged_scaled_timeseries_set(
|
common.tagged_scaled_timeseries_set(
|
||||||
obj,
|
obj,
|
||||||
|
|
|
@ -7,16 +7,16 @@ local pure = require 'pure'
|
||||||
local __math_floor = math.floor
|
local __math_floor = math.floor
|
||||||
|
|
||||||
return function(update_freq, main_state, config, common, width, point)
|
return function(update_freq, main_state, config, common, width, point)
|
||||||
|
local dial_inner_radius = 30
|
||||||
|
local dial_outer_radius = 42
|
||||||
|
local dial_thickness = 5.5
|
||||||
|
local dial_y_spacing = 20
|
||||||
|
|
||||||
local geo = config.geometry
|
local geo = config.geometry
|
||||||
local DIAL_INNER_RADIUS = 30
|
local sep_spacing = geo.sep_spacing
|
||||||
local DIAL_OUTER_RADIUS = 42
|
local text_spacing = geo.text_spacing
|
||||||
local DIAL_THICKNESS = 5.5
|
local plot_sec_break = geo.plot.sec_break
|
||||||
local DIAL_Y_SPACING = 20
|
local plot_height = geo.plot.height
|
||||||
local SEPARATOR_SPACING = geo.sep_spacing
|
|
||||||
local TEXT_SPACING = geo.text_spacing
|
|
||||||
local PLOT_SECTION_BREAK = geo.plot.sec_break
|
|
||||||
local PLOT_HEIGHT = geo.plot.height
|
|
||||||
local TABLE_SECTION_BREAK = geo.table.sec_break
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
-- processor state
|
-- processor state
|
||||||
|
@ -52,26 +52,26 @@ return function(update_freq, main_state, config, common, width, point)
|
||||||
local dial_x = point.x +
|
local dial_x = point.x +
|
||||||
(core_cols == 1
|
(core_cols == 1
|
||||||
and (width / 2)
|
and (width / 2)
|
||||||
or (config.core_padding + DIAL_OUTER_RADIUS +
|
or (config.core_padding + dial_outer_radius +
|
||||||
(width - 2 * (DIAL_OUTER_RADIUS + config.core_padding))
|
(width - 2 * (dial_outer_radius + config.core_padding))
|
||||||
* math.fmod(c - 1, core_cols) / (core_cols - 1)))
|
* math.fmod(c - 1, core_cols) / (core_cols - 1)))
|
||||||
local dial_y = y + DIAL_OUTER_RADIUS +
|
local dial_y = y + dial_outer_radius +
|
||||||
(2 * DIAL_OUTER_RADIUS + DIAL_Y_SPACING)
|
(2 * dial_outer_radius + dial_y_spacing)
|
||||||
* math.floor((c - 1) / core_cols)
|
* math.floor((c - 1) / core_cols)
|
||||||
return {
|
return {
|
||||||
loads = common.make_compound_dial(
|
loads = common.make_compound_dial(
|
||||||
dial_x,
|
dial_x,
|
||||||
dial_y,
|
dial_y,
|
||||||
DIAL_OUTER_RADIUS,
|
dial_outer_radius,
|
||||||
DIAL_INNER_RADIUS,
|
dial_inner_radius,
|
||||||
DIAL_THICKNESS,
|
dial_thickness,
|
||||||
80,
|
80,
|
||||||
nthreads
|
nthreads
|
||||||
),
|
),
|
||||||
coretemp = common.make_text_circle(
|
coretemp = common.make_text_circle(
|
||||||
dial_x,
|
dial_x,
|
||||||
dial_y,
|
dial_y,
|
||||||
DIAL_INNER_RADIUS - 2,
|
dial_inner_radius - 2,
|
||||||
'%s°C',
|
'%s°C',
|
||||||
80,
|
80,
|
||||||
__math_floor
|
__math_floor
|
||||||
|
@ -116,8 +116,8 @@ return function(update_freq, main_state, config, common, width, point)
|
||||||
end
|
end
|
||||||
return common.mk_acc(
|
return common.mk_acc(
|
||||||
width,
|
width,
|
||||||
(DIAL_OUTER_RADIUS * 2 + DIAL_Y_SPACING) * config.core_rows
|
(dial_outer_radius * 2 + dial_y_spacing) * config.core_rows
|
||||||
- DIAL_Y_SPACING,
|
- dial_y_spacing,
|
||||||
update,
|
update,
|
||||||
static,
|
static,
|
||||||
dynamic
|
dynamic
|
||||||
|
@ -133,7 +133,7 @@ return function(update_freq, main_state, config, common, width, point)
|
||||||
point.x,
|
point.x,
|
||||||
y,
|
y,
|
||||||
width,
|
width,
|
||||||
TEXT_SPACING,
|
text_spacing,
|
||||||
{'HWP Preference', 'Ave Freq'}
|
{'HWP Preference', 'Ave Freq'}
|
||||||
)
|
)
|
||||||
local update = function()
|
local update = function()
|
||||||
|
@ -149,7 +149,7 @@ return function(update_freq, main_state, config, common, width, point)
|
||||||
local dynamic = pure.partial(common.text_rows_draw_dynamic, cpu_status)
|
local dynamic = pure.partial(common.text_rows_draw_dynamic, cpu_status)
|
||||||
return common.mk_acc(
|
return common.mk_acc(
|
||||||
width,
|
width,
|
||||||
TEXT_SPACING,
|
text_spacing,
|
||||||
update,
|
update,
|
||||||
static,
|
static,
|
||||||
dynamic
|
dynamic
|
||||||
|
@ -164,8 +164,9 @@ return function(update_freq, main_state, config, common, width, point)
|
||||||
point.x,
|
point.x,
|
||||||
y,
|
y,
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT,
|
plot_height,
|
||||||
PLOT_SECTION_BREAK,
|
geo.plot.ticks_y,
|
||||||
|
plot_sec_break,
|
||||||
"Total Load",
|
"Total Load",
|
||||||
update_freq
|
update_freq
|
||||||
)
|
)
|
||||||
|
@ -178,7 +179,7 @@ return function(update_freq, main_state, config, common, width, point)
|
||||||
end
|
end
|
||||||
return common.mk_acc(
|
return common.mk_acc(
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT + PLOT_SECTION_BREAK,
|
plot_height + plot_sec_break,
|
||||||
update,
|
update,
|
||||||
pure.partial(common.tagged_percent_timeseries_draw_static, total_load),
|
pure.partial(common.tagged_percent_timeseries_draw_static, total_load),
|
||||||
pure.partial(common.tagged_percent_timeseries_draw_dynamic, total_load)
|
pure.partial(common.tagged_percent_timeseries_draw_dynamic, total_load)
|
||||||
|
@ -230,12 +231,12 @@ return function(update_freq, main_state, config, common, width, point)
|
||||||
width = width,
|
width = width,
|
||||||
set_state = update_state,
|
set_state = update_state,
|
||||||
top = {
|
top = {
|
||||||
{mk_cores, show_cores, TEXT_SPACING},
|
{mk_cores, show_cores, text_spacing},
|
||||||
{mk_hwp_freq, config.show_stats, SEPARATOR_SPACING},
|
{mk_hwp_freq, config.show_stats, sep_spacing},
|
||||||
},
|
},
|
||||||
common.mk_section(
|
common.mk_section(
|
||||||
SEPARATOR_SPACING,
|
sep_spacing,
|
||||||
{mk_load_plot, config.show_plot, TABLE_SECTION_BREAK},
|
{mk_load_plot, config.show_plot, geo.table.sec_break},
|
||||||
{mk_tbl, config.table_rows > 0, 0}
|
{mk_tbl, config.table_rows > 0, 0}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@ local impure = require 'impure'
|
||||||
|
|
||||||
return function(update_freq, config, common, width, point)
|
return function(update_freq, config, common, width, point)
|
||||||
local geo = config.geometry
|
local geo = config.geometry
|
||||||
local PLOT_SEC_BREAK = geo.plot.sec_break
|
local plot_sec_break = geo.plot.sec_break
|
||||||
local PLOT_HEIGHT = geo.plot.height
|
local plot_height = geo.plot.height
|
||||||
|
|
||||||
local mod_state = {read = 0, write = 0}
|
local mod_state = {read = 0, write = 0}
|
||||||
local device_paths = sys.get_disk_paths(config.devices)
|
local device_paths = sys.get_disk_paths(config.devices)
|
||||||
|
@ -34,10 +34,11 @@ return function(update_freq, config, common, width, point)
|
||||||
point.x,
|
point.x,
|
||||||
y,
|
y,
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT,
|
plot_height,
|
||||||
|
geo.plot.ticks_y,
|
||||||
format_value_function,
|
format_value_function,
|
||||||
common.converted_y_label_format_generator('B'),
|
common.converted_y_label_format_generator('B'),
|
||||||
PLOT_SEC_BREAK,
|
plot_sec_break,
|
||||||
label,
|
label,
|
||||||
2,
|
2,
|
||||||
update_freq,
|
update_freq,
|
||||||
|
@ -45,7 +46,7 @@ return function(update_freq, config, common, width, point)
|
||||||
)
|
)
|
||||||
return common.mk_acc(
|
return common.mk_acc(
|
||||||
width,
|
width,
|
||||||
PLOT_HEIGHT + PLOT_SEC_BREAK,
|
plot_height + plot_sec_break,
|
||||||
function() common.update_rate_timeseries(obj, mod_state[key]) end,
|
function() common.update_rate_timeseries(obj, mod_state[key]) end,
|
||||||
pure.partial(common.tagged_scaled_timeseries_draw_static, obj),
|
pure.partial(common.tagged_scaled_timeseries_draw_static, obj),
|
||||||
pure.partial(common.tagged_scaled_timeseries_draw_dynamic, obj)
|
pure.partial(common.tagged_scaled_timeseries_draw_dynamic, obj)
|
||||||
|
@ -64,7 +65,7 @@ return function(update_freq, config, common, width, point)
|
||||||
width = width,
|
width = width,
|
||||||
set_state = update_state,
|
set_state = update_state,
|
||||||
top = {
|
top = {
|
||||||
{mk_reads, true, PLOT_SEC_BREAK},
|
{mk_reads, true, plot_sec_break},
|
||||||
{mk_writes, true, 0},
|
{mk_writes, true, 0},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ local i_o = require 'i_o'
|
||||||
local pure = require 'pure'
|
local pure = require 'pure'
|
||||||
|
|
||||||
return function(main_state, config, common, width, point)
|
return function(main_state, config, common, width, point)
|
||||||
local TEXT_SPACING = config.geometry.text_spacing
|
local text_spacing = config.geometry.text_spacing
|
||||||
|
|
||||||
local __string_match = string.match
|
local __string_match = string.match
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ return function(main_state, config, common, width, point)
|
||||||
point.x,
|
point.x,
|
||||||
y,
|
y,
|
||||||
width,
|
width,
|
||||||
TEXT_SPACING,
|
text_spacing,
|
||||||
{'Kernel', 'Uptime', 'Last Upgrade', 'Last Sync'}
|
{'Kernel', 'Uptime', 'Last Upgrade', 'Last Sync'}
|
||||||
)
|
)
|
||||||
-- just update this once
|
-- just update this once
|
||||||
|
@ -35,7 +35,7 @@ return function(main_state, config, common, width, point)
|
||||||
local dynamic = pure.partial(common.text_rows_draw_dynamic, obj)
|
local dynamic = pure.partial(common.text_rows_draw_dynamic, obj)
|
||||||
return common.mk_acc(
|
return common.mk_acc(
|
||||||
width,
|
width,
|
||||||
TEXT_SPACING * 3,
|
text_spacing * 3,
|
||||||
update,
|
update,
|
||||||
static,
|
static,
|
||||||
dynamic
|
dynamic
|
||||||
|
|
Loading…
Reference in New Issue