<<

NAME

Inca::Reporter::Usage - Module for creating simple usage reports

SYNOPSIS

  use Usage;
  my $reporter = new Usage(
    name => 'My Reporter',
    version => 0.1,
    description => 'What my reporter does',
    url => 'http://some.where/'
  );

DESCRIPTION

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 METHODS

#-----------------------------------------------------------------------------#

new

Class constructor which returns a new Usage object. The constructor accepts the parameters supported by Inca::Reporter.

addEntry($entry)

This method is used to add an entry to the usage report. It takes a hash reference 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'.

fail($msg)

This method is used to indicate that the reporter failed. It takes a single arguement which is the error message which will be returned.

getEntries()

Returns an array of all entries that have been added to the reporter.

reportBody

Constructs the body and returns it.

success()

This method is called to indicate that the reporter has succeeded.

EXAMPLE

  Coming soon.

AUTHOR

Jon Dugan <jdugan@ncsa.uiuc.edu>

SEE ALSO

Inca::Reporter

<<