NAME
OpenGuides::Statistics - generate graphs of the number of nodes on an OpenGuides site
SYNOPSIS
use OpenGuides::Statistics;
my $stats =
OpenGuides::Statistics->new( wiki_conf => '/path/to/your/openguides/wiki.conf',
import_date => '2000-01-01' );
my ($total_graph, $rate_graph) = $stats->make_graphs;
my $node_count = $stats->node_count;
DESCRIPTION
This module will read your OpenGuides database and produce Chart::Strip graphs of the data therein to show you how fast you've accumulated nodes.
METHODS
new()
my $stats =
OpenGuides::Statistics->new( wiki_conf => '/path/to/your/openguides/wiki.conf',
import_date => '2000-01-01' );
There's only one required argument, wiki_conf
. This is a path to the configuration file of your OpenGuides installation, which this module will load to know how to access your wiki's database. Optional arguments:
import_date
Use this to ignore a certain date when reading the node creation dates from your database. This is useful if your database was created by importing an existing database, which would otherwise cause a large spike at the beginning of your graph. Takes a date string in the format yyyy-mm-dd.graph_width
Width in pixels of your graphs. Defaults to 640.graph_height
Height in pixels of your graphs. Defaults to 480.total_colour
The colour of the filled area in the "total nodes" graph. Must be a six-digit hex colour, e.g. 6699CC. Defaults to 000000.rate_line_colour
The colour of the line in the rate graph. Defaults to 000000.rate_points_colour
The colour of the points in the rate graph. Defaults to 000000.include_redirects
Show nodes that are only redirects to other nodes. Defaults to 0.error_threshold
To avoid including days when disproportionately large numbers of nodes were created (for whatever reason) and distorting the graph, a threshold of nodes per day is set, counted in multiples of the previous day's total, at which point the day in question will not be included if it breaches the figure. Defaults to 15.
make_graphs()
my ($total_graph, $rate_graph) = $stats->make_graphs;
This method will return two Chart::Strip objects, which have three possible output methods: png()
(returns a PNG image), jpeg()
(returns a JPEG image) and gd()
(returns an underlying GD object). An example of how to use the objects is included in the 'examples' directory of this distribution.
node_count()
my $node_count = $stats->node_count;
This method will return a scalar value of how many nodes there are in your database.
AUTHOR
Earle Martin <EMARTIN@cpan.org>
LEGAL
Copyright 2005 Earle Martin. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.