| 1 | 1 | ▶ | use Object::Pad ':experimental(init_expr)'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | # ABSTRACT: The status of an OpenTelemetry span | ||
| 3 | |||
| 4 | package OpenTelemetry::Trace::Span::Status; | ||
| 5 | |||
| 6 | 1 | our $VERSION = '0.040'; | |
| 7 | |||
| 8 | class OpenTelemetry::Trace::Span::Status { | ||
| 9 | 1 | ▶ | use OpenTelemetry::Common (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | use OpenTelemetry::Constants | ||
| 11 | 1 | ▶ | -span_status => { -as => sub { shift =~ s/^SPAN_STATUS_//r } }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 1 | my $logger = OpenTelemetry::Common::internal_logger; | |
| 14 | |||
| 15 | 7 | field $code :param :reader = UNSET; | |
| 16 | 7 | ▶ | field $description :param :reader = undef; |
|
Subroutine
code: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 17 | |||
| 18 | 7 | ▶ | ADJUST { |
|
Subroutine
description: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 19 | $code = UNSET if $code && $code < UNSET || $code > ERROR; | ||
| 20 | |||
| 21 | if ( $code != ERROR && $description ) { | ||
| 22 | undef $description; | ||
| 23 | $logger->warn('Ignoring description on a non-error span status'); | ||
| 24 | } | ||
| 25 | |||
| 26 | $description //= ''; | ||
| 27 | } | ||
| 28 | |||
| 29 | 2 | ▶ | sub ok ( $class, %args ) { $class->new( %args, code => OK ) } |
|
Subroutine
ok: called CC=1 SCAR=0.0
Pod
documented
| |||
| 30 | 2 | ▶ | sub error ( $class, %args ) { $class->new( %args, code => ERROR ) } |
|
Subroutine
error: called CC=1 SCAR=0.0
Pod
documented
| |||
| 31 | 2 | ▶ | sub unset ( $class, %args ) { $class->new( %args, code => UNSET ) } |
|
Subroutine
unset: called CC=1 SCAR=0.0
Pod
documented
| |||
| 32 | |||
| 33 | 4 | ▶ | method is_ok () { $code == OK } |
|
Subroutine
is_ok: called CC=1 SCAR=0.0
Pod
documented
| |||
| 34 | 4 | ▶ | method is_error () { $code == ERROR } |
|
Subroutine
is_error: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 35 | 4 | ▶ | method is_unset () { $code == UNSET } |
|
Subroutine
is_unset: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 36 | 1 | } | |