| 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 | } | |