Inca::Reporter::Performance - Convenience module for performance-related reporters
use Inca::Reporter::Performance; my $performance = new Inca::Reporter::Performance( name => 'My performance reporter', version => 1, description => 'Measures host performance', url => 'http://inca.sdsc.edu', measurement_name => 'host performance' ); ... my $benchmark = new Inca::Reporter::Performance::Benchmark(); $benchmark->addParameter('num_cpus', 16 ); $benchmark->addStatistic('bandwidth', 10, 'Mb/s'); $performance->addBenchmark('sample', $benchmark); $reporter->print();
Module for writing performance related reporters. A performance reporter has one or more benchmarks. Each benchmark has one or more statistics (i.e., results) and can further be described with one or more parameters. For example,
<performance> <ID>some_id</ID> <benchmark> <ID>sample</ID> <parameters> <ID>parameters</ID> <parameter> <ID>num_cpus</ID> <value>16</value> </parameter> </parameters> <statistics> <ID>statistics</ID> <statistic> <ID>bandwidth</ID> <value>10</value> <units>Mb/s</units> </statistic> </statistics> </benchmark> </performance>
By default, the exit status of the reporter will be set to true (i.e., success). See Inca::Reporter::Performance::Benchmark for more information.
Class constructor which returns a new Inca::Reporter::Performance object. The constructor supports the following parameter in addition to those supported by Inca::Reporter.
the name of the performance metric measured by the reporter; default ''.
shorten the body by printing XML in compact form (i.e., thru attributes); default 0
Add a benchmark to the reporter. $benchmark is an object of type Inca::Reporter::Performance::Benchmark. $name identifies the benchmark.
A convenience that combines the allocation of a benchmark and its addition to the reporter.
Returns the name of the performance metric measured by the reporter.
Constructs and returns the body of the reporter.
Constructs and returns the body of the reporter using no attributes.
Constructs and returns the body of the reporter using attributes to shorten xml.
Sets the name of the performance metric measured by the reporter.
my $reporter = new Inca::Reporter::Performance( name => 'perfeval.local.file.copy', description => 'Measures the time it takes to copy a file from one directory to another', version => 1.3, url => 'http://totally.madeup.org', measurement_name => 'file_transfer_time' ); $reporter->addArg('file'); $reporter->processArgv(@ARGV); my $file = $reporter->getValue('file'); my $start = time(); `cp $file /tmp`; my $elapsed = time() - $start; my $benchmark = new Inca::Reporter::Performance::Benchmark(); $benchmark->addStatistic('elapsed_time', $elapsed, 'secs'); $reporter->addBenchmark('file_transfer_time', $benchmark); $reporter->print();
Shava Smallen <ssmallen@sdsc.edu>