xref: /glogg/tools/perfmeter.pl (revision 5b29309eaadab82731ae94d0f56499131a41184e)
1#!/usr/bin/perl
2
3# Take a debug log from logcrawler and output some perf statistics
4# Can be plotted by echo "plot [ ] [0:0.1] 'foo.data'; pause mouse key;" | gnuplot -
5
6# Or an histogram:
7# plot './qvector.data' using ((floor($1/50)+0.5)*50):(1) smooth frequency w histeps, './qvar_default.data' using ((floor($1/50)+0.5)*50):(1) smooth frequency w histeps, './qvar_50000.data' using ((floor($1/50)+0.5)*50):(1) smooth frequency w histeps
8# Better: plot './0.6.0-3.data' using ((floor($1/0.005)+0.1)*0.005):(0.1) smooth frequency w histeps
9
10while (<>) {
11    strip;
12    if (/(\d\d\.\d\d\d) DEBUG: paintEvent.*firstLine=(\d+) lastLine=(\d+) /) {
13        if ( ($3 - $2) > 35 ) {
14            $beginning = $1;
15            $first_line = $2;
16        }
17    }
18    elsif (/(\d\d\.\d\d\d) DEBUG: End/) {
19        if ($beginning) {
20            $time = $1 - $beginning;
21            # print "$first_line $time\n";
22            if ($time > 0) {
23                print "$time\n";
24            }
25        }
26    }
27}
28