root/tags/mogilefs-server-2.07/modernize-status.pl

Revision 614, 0.5 kB (checked in by bradfitz, 2 years ago)

hacking status tool

  • Property svn:executable set to *
Line 
1 #!/usr/bin/perl
2 use strict;
3 use FindBin qw($Bin);
4
5 my %cmd;
6 my $lastcmd;
7 open (my $fh, "$Bin/lib/MogileFS/Worker/Query.pm");
8 while (<$fh>) {
9     if (/^sub cmd_(\S+)/) {
10         $lastcmd = $cmd{$1} = { cmd => $1, };
11         next;
12     }
13     if (/^\}/) {
14         $lastcmd = undef;
15         next;
16     }
17     next unless $lastcmd;
18     if (/\$dbh/) {
19         $lastcmd->{dbh}++;
20     }
21 }
22
23 foreach my $func (sort keys %cmd) {
24     my $cmd = $cmd{$func};
25     printf("%-20s dbh: %02d t: %1d\n", $func, $cmd->{'dbh'}||0, 0);
26 }
Note: See TracBrowser for help on using the browser.