Listener/Action.pm

filter: Statementstmt 94.1% 32 / 34 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 91.1% 41 / 45 CC 2 SCAR 2.1
CC
2
Cov
92%
process
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Listener.pm ↑ Summary Listener/State.pm »
1 package Synapse::Monitor::Listener::Action;
2 1 ▶use base qw /Synapse::CLI::Config::Object/;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Synapse::Logger;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use YAML::XS;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Time::HiRes;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10  
11 5 ▶sub process {
Subroutine process: called CC=2 SCAR=7.1
Pod undocumented
12 5 my $self = shift;
13 5 my $event = shift;
14 5 my $tmp = File::Spec->tmpdir() . '/' . Time::HiRes::time() . '.tmp.yml';
15 5 ▶ open TEMP, ">$tmp" or do {
Branch: 1 branch
BranchTrueFalseTotal
open TEMP, ">$tmp" or do { logger("cannot write-open $tmp"); return } 5 0 5
16 0 logger ("cannot write-open $tmp");
17 0 return;
18 };
19 5 print TEMP Dump ($event);
20 5 close(TEMP);
21
22 5 my $exec = $self->label();
23 5 logger ("exec YAML_FILE=$tmp $exec");
24 5 system_execute ("YAML_FILE=$tmp $exec");
25  
26 5 unlink $tmp;
27 }
28  
29  
30 sub system_execute {
31 my $msg = shift;
32 system ($msg);
33 }
34  
35  
36 1 1;
37  
38  
39 __END__
« Listener.pm ↑ Summary Listener/State.pm »