line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
13
|
|
|
13
|
|
115
|
use strict; |
|
13
|
|
|
|
|
19
|
|
|
13
|
|
|
|
|
513
|
|
2
|
13
|
|
|
13
|
|
70
|
use warnings; |
|
13
|
|
|
|
|
25
|
|
|
13
|
|
|
|
|
881
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Monitor::MetricsAPI::Metric::String; |
5
|
|
|
|
|
|
|
$Monitor::MetricsAPI::Metric::String::VERSION = '0.900'; |
6
|
13
|
|
|
13
|
|
103
|
use namespace::autoclean; |
|
13
|
|
|
|
|
25
|
|
|
13
|
|
|
|
|
123
|
|
7
|
13
|
|
|
13
|
|
1100
|
use Moose; |
|
13
|
|
|
|
|
17
|
|
|
13
|
|
|
|
|
101
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
extends 'Monitor::MetricsAPI::Metric'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Monitor::MetricsAPI::Metric::String - String metric class for Monitor::MetricsAPI |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 SYNOPSIS |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
use Monitor::MetricsAPI; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $collector = Monitor::MetricsAPI->new( |
20
|
|
|
|
|
|
|
metrics => { host => { name => 'string' } } |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
use Sys::Hostname; |
24
|
|
|
|
|
|
|
$collector->metric('host/name')->set(hostname()); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 DESCRIPTION |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
String metrics allow you to track any arbitrary string values in your metric |
29
|
|
|
|
|
|
|
reporting output that you may wish to include. String metrics are initialized |
30
|
|
|
|
|
|
|
as empty strings. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub BUILD { |
35
|
2
|
|
|
2
|
0
|
4
|
my ($self) = @_; |
36
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
82
|
$self->_set_value(''); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 METHODS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
String metrics do not provide any additional methods beyond the base methods |
43
|
|
|
|
|
|
|
offered by L<Monitor::MetricsAPI::Metric>. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 AUTHORS |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Jon Sime <jonsime@gmail.com> |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
This software is copyright (c) 2015 by OmniTI Computer Consulting, Inc. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or |
54
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. See L<perlartistic>. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, |
57
|
|
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
58
|
|
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=cut |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
63
|
|
|
|
|
|
|
1; |