Processor/Simple.pm

filter: Statementstmt 98.0% 49 / 50 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 4 / 4 totaltotal 98.4% 62 / 63 CC 3 SCAR 3.1
CC
3
Cov
98%
shutdown
2.0
force_flush
2.0
process
1.0
CRAP 1.4
« SDK/Logs/LogRecord/Processor/Batch.pm ↑ Summary SDK/Trace/Sampler/AlwaysOn.pm »
1 4 ▶use Object::Pad ':experimental(init_expr)';
Subroutine BEGIN: called CC=1 SCAR=0.0
2 # ABSTRACT: A basic OpenTelemetry span processor
3  
4 package OpenTelemetry::Processor::Simple;
5  
6 4 our $VERSION = '0.101';
7  
8 3 ▶class OpenTelemetry::Processor::Simple :does(OpenTelemetry::Processor) {
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 ▶ use Feature::Compat::Try;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 ▶ use Future::AsyncAwait;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶ use OpenTelemetry::X;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 4 field $exporter :param;
14  
15 ADJUST {
16 die OpenTelemetry::X->create(
17 Invalid => "Exporter must implement the OpenTelemetry::Exporter interface: " . ( ref $exporter || $exporter )
18 ) unless $exporter && $exporter->DOES('OpenTelemetry::Exporter');
19 }
20  
21 2 ▶ method process ( @items ) {
Subroutine process: called CC=1 SCAR=0.0
Pod documented
22 2 try {
23 2 my $result = $exporter->export(\@items);
24 2 $self->report_result( $result, scalar @items );
25 }
26 catch ($e) {
27 0 warn $e;
28 }
29  
30 2 return;
31 4 }
32  
33 2 ▶ method report_result ( $result, $count ) { $result }
Subroutine report_result: called CC=1 SCAR=0.0
Pod documented
34  
35 2 ▶ async method shutdown ( $timeout = undef ) {
Subroutine shutdown: called CC=2 SCAR=6.9
Pod documented
36 2 await $exporter->shutdown( $timeout );
37 4 }
38  
39 2 ▶ async method force_flush ( $timeout = undef ) {
Subroutine force_flush: called CC=2 SCAR=6.9
Pod documented
40 2 await $exporter->force_flush( $timeout );
41 4 }
42 4 }
« SDK/Logs/LogRecord/Processor/Batch.pm ↑ Summary SDK/Trace/Sampler/AlwaysOn.pm »