From 3988b7defadd30e67f667b062b9385acc6de5098 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sun, 27 Mar 2011 18:27:45 +0000 Subject: [PATCH] background function calls are not dotted --- scripts/gearman2dot.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/gearman2dot.pl b/scripts/gearman2dot.pl index b30ecde..4e889bf 100755 --- a/scripts/gearman2dot.pl +++ b/scripts/gearman2dot.pl @@ -30,7 +30,7 @@ sub print_job { my $wait = $t[$#t] eq 'wait' && pop @t; foreach my $f ( @t ) { dot qq|"$name" -> "$f";|; - dot qq|"$f" -> "${name}_wait";| if $wait; + dot qq|"$f" -> "${name}";| if $wait; } dot "} //subgraph"; } @@ -53,8 +53,11 @@ find(sub { push @{ $job->{task}->{$1} }, 'wait'; } } elsif ( m/\$self->(do\w*)\(\s*'(\w+)'/ ) { - push @{ $job->{$1} }, $2; - dot qq|"$job->{name}" -> "$2" [ label="$1" ];|; + my ( $do, $what ) = ( $1, $2 ); + push @{ $job->{$do} }, $what; + my $style = ''; + $style = ' style=dotted ' if $do =~ s/_background.*//; + dot qq|"$job->{name}" -> "$what" [ $style ];|; } } print_job $name => $job; -- 2.20.1