NAME

oEdtk::Tracking - object-oriented production tracking

SYNOPSIS

use oEdtk::Tracking qw(stats_week);

my $trk = oEdtk::Tracking->new($source, user => 'utest', entity => 'Corp');
$trk->track('Job', 1, @values);
$trk->end;

DESCRIPTION

Records tracking events (job, spool, document, warn, halt) for a batch run into the table named by the EDTK_DB configuration, and offers a few statistics queries over that table. When EDTK_TRACK_MODE is NONE the constructor returns an inert object and every method becomes a no-op. This is the current module; Tracking2.pm is the older, warn-based duplicate that declares the same package oEdtk::Tracking.

METHODS

new

my $trk = oEdtk::Tracking->new($source, %params);

Build a tracker. $source names the input, and %params may carry user, entity, keys, edmode, account, obj_typ, child_typ, child_id and parent_id. An omitted $source falls back to @ARGV; an explicit empty string means no input file and is kept. Dies when there are too many keys or a duplicate key.

track

$trk->track($job, $count, @data);

Record one event: the job event, the number of objects, and the values of the configured user keys (an optional trailing value is the message). Values longer than the schema allows are truncated. When no message is supplied, ED_MESSAGE names the function that recorded the event.

set_entity

$trk->set_entity($entity);

Normalise $entity through the dictionary and store it.

end

$trk->end;

Record the final Halt event.

FUNCTIONS

stats_iddest

my $rows = stats_iddest($dbh, $cfg, $start, $end, $excluded_users, $ed_app);

Per recipient destination, per week, the number of documents tracked between $start and $end.

stats_week

my $rows = stats_week($dbh, $cfg, $start, $end, $excluded_users);

Per application, per legal entity and per ISO week, the number of documents tracked during the period.

stats_month

my $rows = stats_month($dbh, $cfg, $start, $end, $excluded_users);

Per application, per legal entity and per month, the number of documents tracked during the period.

The following subs are internal helpers and are not part of the public API: _tracking_insert, _tracking_schema_warn, _validate_event and _validate_edmode.

AUTHOR

The oEdtk team.