time-based histograms: docs and test

This commit is contained in:
Dima Kogan
2021-07-22 17:20:13 -07:00
parent 83df85a8c0
commit a965d9f2ec
14 changed files with 1206 additions and 1457 deletions

View File

@@ -39,7 +39,7 @@ BEGIN {
}
}
use Test::More tests => 92;
use Test::More tests => 94;
use File::Temp 'tempfile';
use IPC::Run 'run';
use String::ShellQuote;
@@ -346,6 +346,13 @@ tryplot( testname => 'Circles',
options => [qw(--circles --domain)],
refplot => 'circles.ref' );
tryplot( testname => '--timefmt --histo',
cmd => q{seq 10 | gawk '{x=(NR-1)%5; print strftime("%Y-%m-%d--%H:%M:%S",1382249107+x,1)}' | grep -v ':09'},
options => ['--timefmt', '%Y-%m-%d--%H:%M:%S', '--histogram', '0','--binwidth', '1',
'--set', q{format x "...-%M:%S"},
'--ymax', '2.5'],
refplot => 'timefmt-histo.ref' );

39
t/timefmt-histo.ref Normal file
View File

@@ -0,0 +1,39 @@
2.5 +-----------------------------------------------------------------------------------------+
| + + + + + |
| |
| |
| |
| |
| |
2 |-+ ******************************* ******************************* +-|
| * * * * * * |
| * * * * * * |
| * * * * * * |
| * * * * * * |
| * * * * * * |
| * * * * * * |
1.5 |-+ * * * * * * +-|
| * * * * * * |
| * * * * * * |
| * * * * * * |
| * * * * * * |
| * * * * * * |
| * * * * * * |
| * * * * * * |
1 |-+ * * * * * * +-|
| * * * * * * |
| * * * * * * |
| * * * * * * |
| * * * * * * |
| * * * * * * |
| * * * * * * |
0.5 |-+ * * * * * * +-|
| * * * * * * |
| * * * * * * |
| * * * * * * |
| * * * * * * |
| * * * * * * |
| * + * + * + * + * + * |
0 +-----------------------------------------------------------------------------------------+
...-05:06 ...-05:07 ...-05:08 ...-05:09 ...-05:10 ...-05:11 ...-05:12