The following is a functional first pass. I'm having difficulty finding
particular messages in more than a few places in the logs off hawk, so
there's not terribly much insight to be gained from the pictures. It
could be related to the trouble I'm observing on my node with there
being many more requesters than log submitters. Any ideas why that
could be?
#-----------------------------------------------------------------------
----
#!/usr/bin/perl -w
use strict;
# usage: perl track.pl <msgid> <log> [, <log>, ...]
# try putting all the logs (10.0.0.0, etc.) in a directory
# and using 'perl /path/to/track.pl msgid * > track.dot'
# prints out a graphviz DOT input with nodes named as IP addresses
# and edges labeled with send/receive and seconds in the day
my $track_id = shift @ARGV; # id of message to track
my @logs = @ARGV; # logs assumed to have IP address filenames like on
hawk
my %events = ( sent => 'S', received => 'R' );
die "no msg specified" unless $track_id;
die "no logfiles specified" unless @logs;
my @edges;
for my $log ( @logs ) {
print STDERR "Processing $log...\n";
open LOG, "< $log" or die "Could not open $log";
while ( <LOG> ) {
my ( $time, $event, $response, $msg_id,
$transport, $host, $port ) = split /[\s\/:]/, $_;
if ( $msg_id eq $track_id ) {
if ( $event eq 'sent' ) {
push @edges, {
src => $log, tgt => $host, time => $time,
event => $event, response => $response
};
}
else {
push @edges, {
src => $host, tgt => $log, time => $time,
event => $event, response => $response
};
}
}
}
}
printf "digraph %s {\n", $track_id;
for ( @edges ) {
printf " \"%s\" -> \"%s\" [label=\"%s@%s\"];\n",
$_->{ src }, $_->{ tgt },
$events{ $_->{ event } },
$_->{ time } % 86400;
}
print "}\n";
#-----------------------------------------------------------------------
----
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]] On Behalf Of Ian Clarke
> Sent: Wednesday, May 29, 2002 11:42 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [Tech] Graphing watchme output
>
>
> If anyone out there fancies putting their Perl, Python, or
> whatever skills to an easy but interesting problem, how about
> writing something which isolates a single message from the watchme
> logs (at http://hawk.freenetproject.org/~watchme/logs) and uses it
> to produce some input for something like Graphviz
> (http://www.research.att.com/sw/tools/graphviz/)?
>
> Any takers?
>
> Ian.
>
> --
> Ian Clarke
> [EMAIL PROTECTED]
> Founder & Coordinator, The Freenet Project
> http://freenetproject.org/
> Chief Technology Officer, Uprizer
> Inc. http://www.uprizer.com/
> Personal Homepage http://locut.us/
>
_______________________________________________
devl mailing list
[EMAIL PROTECTED]
http://hawk.freenetproject.org/cgi-bin/mailman/listinfo/devl