LogParser
- Class to parse an AuroraDB log-entries hash returned from method getLogEntries().
use AuroraDB;
use LogParser;
my $db = AuroraDB->new(...);
my $id=1234;
my $log=$db->getLogEntries($id);
my $parser = LogParser->new(log=>$log);
my $result = $parser->parse();
Class to parse a Log-hash and its content and pick out relevant information from it, including dataset type, status, remote size, transfer log and more.
It will parse the log-entries from the beginning to the end and pick out relevant information.
Instantiates the class.
It takes the following parameters:
log HASH-reference to the AuroraDB log-hash. HASH-reference. Required. See the parse()-method below for the structure.
Returns a class instance upon success.
Parses an AuroraDB log-hash and returns relevant aggregated information about the life of the dataset in question.
The method does not accept any parameters and returns a hash-reference upon success that are structured accordingly:
logdata => (
dataset_type => SCALAR # MANUAL/AUTOMATIC
removed_time => SCALAR # Unix datetime
acquire_phase_store_class => SCALAR # Store-class used to perform acquire operation 1
transfer_log => (
1 => SCALAR # transfer log entry no 1
2 => SCALAR # transfer log entry no 2
.
.
n => SCALAR # transfer log entry no n
)
status => SCALAR # OPEN/CLOSED
closed_by => SCALAR # service id or user id if > 0
task_id => SCALAR # Store-service task id used during acquire-phase
distlog => (
1 => SCALAR # distlog-entry no 1
.
.
n => SCALAR # distlog-entry no n
)
remote_size => SCALAR # size of remote data
transfer_all_completed => SCALAR # all transfer completed successfully (0/1)
acquire_phase_completed => SCALAR # acquire-phase completed successfully (0/1)
acquire_phase_failure_count => SCALAR # no times the acquire-phase failed
acquire_phase_run_count => SCALAR # no of times the acquire-phase ran
acquire_phase_simultaneous => SCALAR # did several acquire-phase processes run simultaneously? (0/1)
)
Not all values will necessarily be present in the return logdata. That depends on the history of the dataset and what is in its log. Eg. "removed_time" will not be there if the dataset was not removed yet. In a similar manner the "closed_by" will not exist if the dataset has not been closed yet. Also some values will not be there if the dataset is of MANUAL type. This includes the values remote_size, transfer_all_completed and all the acquire_phase ones (they will have 0/false values).