Apache-Scoreboard
view release on metacpan or search on metacpan
examples/scoreboard-access-png.pl view on Meta::CPAN
use strict;
use Apache::ScoreboardGraph ();
use constant IS_MODPERL => exists $ENV{MOD_PERL};
my($image, $r);
if (IS_MODPERL) {
$r = shift;
$r->send_http_header('image/gif');
$image = Apache::Scoreboard->image;
}
else {
my $host = shift || "localhost";
$image = Apache::Scoreboard->fetch("http://$host/scoreboard");
}
my $sbgraph = Apache::ScoreboardGraph->new({image => $image});
my($graph, $data) = $sbgraph->access;
if (IS_MODPERL) {
print $graph->plot($data);
}
else {
$graph->plot_to_png("scoreboard-access.png", $data);
}
( run in 0.884 second using v1.01-cache-2.11-cpan-df04353d9ac )