Monitor::MetricsAPI::Metric::Counter - Counter metric class for Monitor::MetricsAPI
use Monitor::MetricsAPI; my $collector = Monitor::MetricsAPI->new( metrics => { messages => { incoming => 'counter' } } ); # Later on, when a new message is received by your app: $collector->metric('messages/incoming')->increment;
Counter metrics are numeric values which initialize at zero and only increase over the lifetime of the monitored process. Counter metrics are appropriate when you simply want to know how many times X occurred.
The following methods are specific to counter metrics. Monitor::MetricsAPI::Metric defines methods which are common to all metric types.
Adds $amount to the current value of the metric.
Increases the value of the metric by 1 each time it is called. Produces the same effect as calling $metric->add(1), which is unsurprising since that is exactly what this method does.
Alias for increment()
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.