topper::datasink - Data output handler.
use topper::datasink;
$config->load('path/to/somefile.conf');
# <snip>
# ... init topper::database object and topper::otuput object.
# </snip>
my $ds = topper::datasink->new($config,$database_object,$output_object);
$ds->start_new_process();
$ds->process_name("foo");
$ds->process_pid(1234);
# ... etc
$ds->run_output();
This package provides a wrapper for writing the actual output of process info to a destination, which can be a database, or perhaps an xml file, etc,... (Currently only mysql database sink is implemented).
new(topper::config configuration_object, topper::database database_object, topper::output output_object)Constructor. Initialises class member variables.
Input: topper::config Pass the configuration object. Input: topper::database Pass the database object. Input: topper::output Pass the output object. Output: blessed object.
start_new_process()Begins processing output for a new process.
Input: Nothing. Output: Nothing.
reset_entry_time()Resets timestamps to current date and time for process entries that follow.
Input: Nothing. Output: Nothing.
process_pidSets pid for current process.
Input: (int) pid Output: Nothing.
process_userSets user for current process.
Input: (string) user Output: Nothing.
process_cpuSets cpu usage for current process.
Input: (number) cpu Output: Nothing.
process_memSets memory consumption for current process.
Input: (number) memory Output: Nothing.
process_nameSets command name for current process.
Input: (string) name Output: Nothing.
run_outputBegins processing output for current process into configured sink.
Input: Nothing Output: Nothing.