From feb1f9ae69af4fcf902ec278fd604d425dca0680 Mon Sep 17 00:00:00 2001 From: sageweil Date: Thu, 30 Aug 2007 18:31:24 +0000 Subject: [PATCH] asdf git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1744 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/script/plot.pl | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 trunk/ceph/script/plot.pl diff --git a/trunk/ceph/script/plot.pl b/trunk/ceph/script/plot.pl new file mode 100755 index 0000000000000..e121f09a20120 --- /dev/null +++ b/trunk/ceph/script/plot.pl @@ -0,0 +1,45 @@ +#!/usr/bin/perl + +use strict; + +my $dir = shift @ARGV; +my $type = shift @ARGV; + +# list files +my @files; +my %fields; +for my $f (`ls $dir/$type*`) { + chomp $f; + next unless $f =~ /$type(\d+)$/; + push(@files, $f); + unless (%fields) { + open(I,$f); + while () { + next unless /^\#/; + my @f = split(/\t/,$_); + for (my $n=1; @f; $n++) { + my $f = shift @f; + $fields{$f} = $n; + #print "$f = $n\n"; + } + last; + } + close I; + } +} +#print "#files @files\n"; + +# get field names +print "set style data lines\n"; +print "set title \"$dir\"\n"; +my $var = shift @ARGV; +my $rest = join(' ', @ARGV); +#for my $var (@ARGV) { + my @p; + for my $f (@files) { + my ($lastbit) = $f =~ /\/([^\/]+)$/; + push(@p, "\"$f\" u 1:$fields{$var} $rest t \"$lastbit\""); + } + print "plot " . join(',', @p) . "\n"; +#} +print "pause 100000000\n"; -- 2.39.5