Monitor::MetricsAPI::Metric::Timestamp - Timestamp metric class for Monitor::MetricsAPI
use Monitor::MetricsAPI; my $collector = Monitor::MetricsAPI->new( metrics => { auditing => { admin => { last_lockout => 'timestamp' } } } ); # Later on, when a client is locked out of your admin functions because # of repeated authentication failures: $collector->metric('auditing/admin/last_lockout')->now;
Timestamp metrics allow you to record the time at which an event most recently occurred. The base set() method is disabled (a warning will be emitted if you call it, and no other action will be taken). All timestamp metrics initialize to an empty value, and are always displayed in reporting output as UTC in the ISO-8601 format.
The following methods are specific to timestamp metrics. Monitor::MetricsAPI::Metric defines methods which are common to all metric types.
Sets the value of the timestamp metric to the current time.
Returns a DateTime object, suitable for use in date calculations.
Overrides the set() method provided by the base Metric class. Emits a warning whenever called, and performs no other actions.
Jon Sime <jonsime@gmail.com>
This software is copyright (c) 2015 by OmniTI Computer Consulting, Inc.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install Monitor::MetricsAPI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Monitor::MetricsAPI
CPAN shell
perl -MCPAN -e shell install Monitor::MetricsAPI
For more information on module installation, please visit the detailed CPAN module installation guide.