OpenTracing/SpanContext.pm

filter: Statementstmt 75.0% 18 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 62.5% 5 / 8 Podpod 100% 3 / 3 totaltotal 74.2% 26 / 35 CC 1 SCAR 3.2
CC
1
Cov
75%
span
2.0
log
2.0
new_span
2.0
CRAP 1.4
« OpenTracing/Any.pm ↑ Summary OpenTracing/Tag.pm »
1 package OpenTracing::SpanContext;
2  
3 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 8 our $VERSION = '1.006'; # VERSION
7 8 our $AUTHORITY = 'cpan:TEAM'; # AUTHORITY
8  
9 8 ▶use parent qw(OpenTracing::Common);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 8 ▶no indirect;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 8 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 =encoding utf8
15  
16 =head1 NAME
17  
18 OpenTracing::SpanContext - tracks IDs and baggage for spans
19  
20 =head1 DESCRIPTION
21  
22 =cut
23  
24 =head2 span
25  
26 Returns the L<OpenTracing::Span> instance that this wraps.
27  
28 =cut
29  
30 0 ▶sub span { shift->{span} }
Subroutine span: not called CC=1 SCAR=6.9
Pod documented
31  
32 =head2 log
33  
34 Writes a log entry to the L<OpenTracing::Span>.
35  
36 =cut
37  
38 0 ▶sub log { shift->span->log(@_) }
Subroutine log: not called CC=1 SCAR=6.9
Pod documented
39  
40 =head2 new_span
41  
42 Creates a new sub-span under this L<OpenTracing::Span> instance.
43  
44 =cut
45  
46 0 ▶sub new_span {
Subroutine new_span: not called CC=1 SCAR=6.9
Pod documented
47 0 my ($self, $name, %args) = @_;
48 0 my $parent = $self->span;
49 0 @args{qw(trace_id parent_id)} = (
50 $parent->trace_id,
51 $parent->id,
52 );
53 0 $parent->tracer->span(operation_name => $name, %args);
54 }
55  
56 =head2 DESTROY
57  
58 Called on destruction, will mark completion on the span by calling
59 L<OpenTracing::Span/finish>.
60  
61 =cut
62  
63 8 1;
64  
65 __END__
« OpenTracing/Any.pm ↑ Summary OpenTracing/Tag.pm »