line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::Saftpresse::CountersOutput::JSON; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1587
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
56
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: plugin to dump counters in JSON format |
7
|
|
|
|
|
|
|
our $VERSION = '1.6'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
4
|
use base 'Log::Saftpresse::CountersOutput'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
105
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
12
|
use JSON; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
9
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub output { |
14
|
0
|
|
|
0
|
0
|
|
my ( $self, $counters ) = @_; |
15
|
0
|
|
|
|
|
|
my $json = JSON->new; |
16
|
0
|
|
|
|
|
|
$json->pretty(1); |
17
|
|
|
|
|
|
|
my %data = map { |
18
|
0
|
|
|
|
|
|
$_ => $counters->{$_}->counters, |
|
0
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
} keys %$counters; |
20
|
0
|
|
|
|
|
|
print $json->encode( \%data ); |
21
|
0
|
|
|
|
|
|
return; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=pod |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=encoding UTF-8 |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Log::Saftpresse::CountersOutput::JSON - plugin to dump counters in JSON format |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 VERSION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
version 1.6 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 AUTHOR |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Markus Benning <ich@markusbenning.de> |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
This software is Copyright (c) 1998 by James S. Seymour, 2015 by Markus Benning. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
This is free software, licensed under: |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
The GNU General Public License, Version 2, June 1991 |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |