]> git.sesse.net Git - nms/blobdiff - web/nettkart.pl
Optimize the get_datarate() function, using some SQL and some C instead.
[nms] / web / nettkart.pl
index 89c63eaca08af3b9de603ec83b37084acdbebec1..bff972bbd4b9a08f3f5ac96ffbcc956df1c8d4c6 100755 (executable)
@@ -55,9 +55,7 @@ $text_img->stringFT($tclr, "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf",
 $text_img->stringFT($tclr, "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf", 10, 0, 40, 47 + (236-42)*4.0/4.0, "10 Mbit/sec");
 $text_img->stringFT($tclr, "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf", 10, 0, 1000, 620, "NMS (C) 2005-2007 Tech:Server");
 
-my $q = $dbh->prepare('select * from switches natural join placements natural left join
-( select switch,sum(bytes_in) as bytes_in,sum(bytes_out) as bytes_out from get_datarate() group
-by switch ) t1 order by zorder');
+my $q = $dbh->prepare('select * from switches natural join placements natural left join current_datarate order by zorder');
 $q->execute();
 while (my $ref = $q->fetchrow_hashref()) {