diff options
| -rw-r--r-- | lib/MGA/Mirrors/Controller/Graph.pm | 7 | ||||
| -rw-r--r-- | root/html/pages/report/index.tt | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/MGA/Mirrors/Controller/Graph.pm b/lib/MGA/Mirrors/Controller/Graph.pm index 5d39b53..a2b6ad6 100644 --- a/lib/MGA/Mirrors/Controller/Graph.pm +++ b/lib/MGA/Mirrors/Controller/Graph.pm @@ -42,7 +42,12 @@ sub index :Path :Args(0) { $graph->add_node($_, shape => 'box', cluster => $node{$_}{country}); } } - $graph->add_edge($from, $to); + # Minimum bandwidth of both nodes + my $bandwidth = ($node{$from}{bandwidth} < $node{$to}{bandwidth}) ? $node{$from}{bandwidth} : $node{$to}{bandwidth}; + $bandwidth = 1 if (!$bandwidth); + my $thickness = log($bandwidth) / log(3) - 16; # Scale line thickness from bandwidth + $thickness = ($thickness < 1) ? 1 : $thickness; + $graph->add_edge($from => $to, penwidth => $thickness); } } $c->stash->{graphviz}->{graph} = $graph; diff --git a/root/html/pages/report/index.tt b/root/html/pages/report/index.tt index c234ddd..6121133 100644 --- a/root/html/pages/report/index.tt +++ b/root/html/pages/report/index.tt @@ -108,3 +108,4 @@ to Tier2 mirrors.</p> <h2>Synchronisation tree</h2> <img src="[% c.uri_for('/graph') %]"> +<p>Line thickness is proportional to bandwidth.</p> |
