xref: /glogg/tools/perfmeter.pl (revision 4749edd39cd80269d67cb1e8a23b9a211d670a7c)
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
6while (<>) {
7    strip;
8    if (/(\d\d\.\d\d\d) DEBUG: paintEvent.*firstLine=(\d+) lastLine=(\d+) /) {
9        if ( ($3 - $2) > 35 ) {
10            $beginning = $1;
11            $first_line = $2;
12        }
13    }
14    elsif (/(\d\d\.\d\d\d) DEBUG: End/) {
15        if ($beginning) {
16            $time = $1 - $beginning;
17            print "$first_line $time\n";
18        }
19    }
20}
21