Skip to content
Snippets Groups Projects
Commit 21013ec7 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

TaskStatistics: improved visualization

parent 5054a271
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ classdef GtTasksStatistics < handle
methods
function self = GtTasksStatistics(varargin)
[~, self.host_name] = system('hostname');
self.host_name = regexprep(self.host_name, '\\n', '');
self = parse_pv_pairs(self, varargin);
end
......@@ -67,12 +68,18 @@ classdef GtTasksStatistics < handle
max_descr_length = max(cellfun(@(x)length(self.entries.(x).description), fields));
max_descr_length = max(mod(4 - mod(max_descr_length, 4), 4) + 2 + max_descr_length, 4);
format_str = ['%' sprintf('%d', max_descr_length) 's: %10s (s) [mean %10s (s), std %f (s), %d invocations]\n'];
format_str = ['%' sprintf('%d', max_descr_length) ...
's: %10s (s) [mean %10s (s), std %f (s), %d invocations]\n'];
format_str_alternative = ['%' sprintf('%d', max_descr_length) 's: No invocations\n'];
format_str_partial = ['%' sprintf('%d', max_descr_length+2) 's: %10s (s) [mean %10s (s), std %f (s), %d invocations]\n'];
format_str_partial = ['%' sprintf('%d', max_descr_length+2) ...
's: %10s (s) [mean %10s (s), std %f (s), %d invocations]\n'];
fprintf(['%' sprintf('%d', max_descr_length) 's: %s\n'], 'Hostname', self.host_name)
sep_str = [repmat('-', [1 max_descr_length]) '+' ...
repmat('-', [1 min(max(2*numel(self.host_name), 20), 80-max_descr_length-1)]) '\n'];
fprintf(sep_str);
fprintf(['%' sprintf('%d', max_descr_length) 's: %s\n'], 'Hostname', self.host_name);
fprintf(sep_str);
for ii = 1:numel(fields)
entry = self.entries.(fields{ii});
......@@ -98,6 +105,7 @@ classdef GtTasksStatistics < handle
fprintf(format_str_alternative, entry.description);
end
end
fprintf(sep_str);
end
function res = get_mean(self, name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment