xref: /glogg/tools/perfmeter.pl (revision 6a9e5a533ceced00013ce708d721e7ddff48be85)
1257f352aSNicolas Bonnefon#!/usr/bin/perl
2257f352aSNicolas Bonnefon
3257f352aSNicolas Bonnefon# Take a debug log from logcrawler and output some perf statistics
4948fb2faSNicolas Bonnefon# Can be plotted by echo "plot [ ] [0:0.1] 'foo.data'; pause mouse key;" | gnuplot -
5257f352aSNicolas Bonnefon
6d0deb8b4SNicolas Bonnefon# Or an histogram:
7d0deb8b4SNicolas Bonnefon# 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
8d0deb8b4SNicolas Bonnefon# Better: plot './0.6.0-3.data' using ((floor($1/0.005)+0.1)*0.005):(0.1) smooth frequency w histeps
9d0deb8b4SNicolas Bonnefon
10257f352aSNicolas Bonnefonwhile (<>) {
11257f352aSNicolas Bonnefon    strip;
12*6a9e5a53SNicolas Bonnefon    if (/(\d\d\.\d\d\d) DEBUG4.*paintEvent.*firstLine=(\d+) lastLine=(\d+) /) {
13257f352aSNicolas Bonnefon        if ( ($3 - $2) > 35 ) {
14257f352aSNicolas Bonnefon            $beginning = $1;
15257f352aSNicolas Bonnefon            $first_line = $2;
16257f352aSNicolas Bonnefon        }
17257f352aSNicolas Bonnefon    }
18*6a9e5a53SNicolas Bonnefon    elsif (/(\d\d\.\d\d\d) DEBUG4.*End/) {
19257f352aSNicolas Bonnefon        if ($beginning) {
20257f352aSNicolas Bonnefon            $time = $1 - $beginning;
21d0deb8b4SNicolas Bonnefon            # print "$first_line $time\n";
22d0deb8b4SNicolas Bonnefon            if ($time > 0) {
23d0deb8b4SNicolas Bonnefon                print "$time\n";
24d0deb8b4SNicolas Bonnefon            }
25257f352aSNicolas Bonnefon        }
26257f352aSNicolas Bonnefon    }
27257f352aSNicolas Bonnefon}
28