Changeset 281


Ignore:
Timestamp:
Sep 25, 2017, 7:34:53 PM (7 years ago)
Author:
g7moreau
Message:
  • Add invisible node on dot graph
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r280 r281  
    28002800   my $timestamp                   =   $switch_connection->{'timestamp'};
    28012801
     2802   my $invisible_node = 0; # Count number of invisible node
     2803
    28022804   my %db_building= ();
     2805   my %db_switch_line = (); # Number of line drawed on a switch
    28032806   for my $sw (@SWITCH_LIST) {
    28042807      my ($building, $location) = split m/ \/ /xms, $sw->{'location'}, 2;
     
    28062809      $db_building{$building}->{$location} ||= {};
    28072810      $db_building{$building}->{$location}{ $sw->{'hostname'} } = 'y';
     2811     
     2812      $db_switch_line{$sw} = 0;
    28082813      }
    28092814
     
    28672872               print "\"$sw:$port_connect\" [label = \"".format_aggregator4dot($port_connect)."\", color = black, fillcolor = plum,  peripheries = $peripheries, style = filled];\n";
    28682873               print "\"$sw:$port_connect\" -> \"$sw\" [len=2, style=bold, color = $color, arrowhead= normal, arrowtail = inv]\n";
     2874               
     2875               $db_switch_line{$sw}++;
     2876               if ($db_switch_line{$sw} % 9 == 0) {
     2877                  # Create invisible node
     2878                  $invisible_node++;
     2879                  my $invisible = '__Invisible_' . $invisible_node;
     2880                  print "$invisible [shape=none, label=\"\"]\n";
     2881                  print "\"$sw:$port_connect\" -> $invisible [style=invis]\n";
     2882                  print "$invisible            -> \"$sw\"    [style=invis]\n";
     2883                  }
    28692884              }
    28702885            }
Note: See TracChangeset for help on using the changeset viewer.