[Swift-devel] Formatting kickstart records
Michael Wilde
wilde at mcs.anl.gov
Mon Sep 10 10:14:46 CDT 2007
I started a small perl script to format kickstart records.
For now, for each kickstart output file on the cmd line it prints
one-liners of the form:
Start=2007-09-09T00:24:43.161-05:00 duration=83.993 user=82.470
sys=1.360 machine=i686 host=tg-v050.uc.teragrid.org
but its pretty generalizable.
I did this to find the min, max and stats on run times, looking for
outliers that are holding up the workflow.
If anyone has a similar/better tool please point it out, otherwise I'll
continue to enhance this. Suggestions for a better approach are welcome.
Pavel (summer student) did something like this in C a while back; I
thought that was added to vds/contrib at that time but I dont see it in
the latest VDS release. Need to hunt it down.
This perl script is very simple and easy, but rather slow on 1000
kickstart records (need to get timings; Im sure it can be improved,
possibly by grabbing multiple fields on each XPath call.
- Mike
$ cat ~/vds/kix
#!/usr/bin/perl -w -I/home/wilde/vds
# ^^^ How to best set the module path?
# Print fields from a list of invocation record xml files
use strict;
use XML::XPath;
use XML::XPath::XMLParser;
while(@ARGV) {
print_irec(shift @ARGV);
}
sub print_irec
{
my $irec = shift;
my $xp = XML::XPath->new(filename => $irec);
my $start = $xp->findvalue('/invocation/mainjob/@start');
my $utime = $xp->findvalue('/invocation/mainjob/usage/@utime');
my $stime = $xp->findvalue('/invocation/mainjob/usage/@stime');
my $duration = $xp->findvalue('/invocation/mainjob/@duration');
my $machine = $xp->findvalue('/invocation/uname/@machine');
my $host = $xp->findvalue('/invocation/@hostname');
print "Start=$start duration=$duration user=$utime sys=$stime
machine=$machine host=$host\n";
}
More information about the Swift-devel
mailing list