File: perfmeter.pl

package info (click to toggle)
glogg 1.1.4-1.4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,412 kB
  • sloc: cpp: 12,813; sh: 117; perl: 32; sed: 25; makefile: 6
file content (27 lines) | stat: -rwxr-xr-x 996 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl

# Take a debug log from logcrawler and output some perf statistics
# Can be plotted by echo "plot [ ] [0:0.1] 'foo.data'; pause mouse key;" | gnuplot -

# Or an histogram:
# 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
# Better: plot './0.6.0-3.data' using ((floor($1/0.005)+0.1)*0.005):(0.1) smooth frequency w histeps

while (<>) {
    strip;
    if (/(\d\d\.\d\d\d) DEBUG4.*paintEvent.*firstLine=(\d+) lastLine=(\d+) /) {
        if ( ($3 - $2) > 35 ) {
            $beginning = $1;
            $first_line = $2;
        }
    }
    elsif (/(\d\d\.\d\d\d) DEBUG4.*End/) {
        if ($beginning) {
            $time = $1 - $beginning;
            # print "$first_line $time\n";
            if ($time > 0) {
                print "$time\n";
            }
        }
    }
}