]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
scripts: make mds request checker show the operation
authorSage Weil <sage@newdream.net>
Mon, 30 Mar 2009 22:11:52 +0000 (15:11 -0700)
committerSage Weil <sage@newdream.net>
Tue, 31 Mar 2009 17:24:57 +0000 (10:24 -0700)
src/script/check_mds_request_latency.pl

index d88e14c3176b96727cde8569a633e78ea250cffb..55b71a2591b63e0481d6ac6792a1abea1495df43 100755 (executable)
@@ -3,6 +3,7 @@
 use strict;
 
 my %r;      # reqid -> start
+my %what;
 my %lat_req;  # latency -> request
 
 sub tosec($) {
@@ -15,14 +16,15 @@ sub tosec($) {
 
 while (<>) {
     chomp;
-    my ($stamp) = /^\S+ (\S+) /;
+    my ($stamp) = /^\S+ (\S+)/;
 
-    my ($what,$req) = /\d+ -- \S+ mds\d+ ... client\d+ \S+ \S+ client_(request|reply)\((\S+)/;
+    my ($what,$req,$desc) = /\d+ -- \S+ mds\d+ ... client\d+ \S+ \S+ client_(request|reply)\((\S+) ([^\)]+)/;
     
     if (defined $req) {
-       #print "$what $req at $stamp\n";
+       #print "$what $req at $stamp $desc\n";
        if ($what eq 'request') {
            $r{$req} = $stamp;
+           $what{$req} = $desc;
        } elsif ($what eq 'reply') {
            if (exists $r{$req}) {
                my $len = tosec($stamp) - tosec($r{$req});
@@ -42,5 +44,6 @@ while (<>) {
 
 
 for my $len (sort {$b <=> $a} keys %lat_req) {
-    print "$len\t$lat_req{$len}\n";    
+    my $req = $lat_req{$len};
+    print "$len\t$req\t$what{$req}\n";    
 }