Usage - Module for creating simple usage reports
use Usage; my $reporter = new Usage( name => 'My Reporter', version => 0.1, description => 'What my reporter does', url => 'http://some.where/'A );
This module is a subclass of Inca::Reporter which provides a simple schema for reporting usage data. The reporter will return the following body if the reporter is successful:
<usage> <entry> <type>type1</type> <name>foo</name> <statistics> <statistic> <name>count</name> <value>9</value> </statistic> </statistics> </entry> <entry> . . . </usage>
Class constructor which returns a new Usage object. The constructor accepts the parameters supported by Inca::Reporter.
Constructs the body and returns it.
This method is used to add an entry to the usage report. It takes a hash containing the type and name of the entry as well as a hash of statistics. For example:
addEntry( { 'type' => 'foo', 'name' => 'bar', 'stats' => { 'count' => 1, 'blort' => 'baz' } });
Will create an entry of type 'foo', with a name of 'bar' and two statistics, count with a value of 1 and 'blort' with a value of 'baz'.
This method is used to indicate that the reporter failed. It takes a single arguement which is the error message which will be returned.
This method is called to indicate that the reporter has succeeded.
Coming soon.
Jon Dugan <jdugan@ncsa.uiuc.edu>