File Coverage

blib/lib/OpenTracing/Interface/Span.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 24 24 100.0


line stmt bran cond sub pod time code
1             package OpenTracing::Interface::Span;
2              
3 3     3   564041 use strict;
  3         30  
  3         88  
4 3     3   16 use warnings;
  3         8  
  3         146  
5              
6              
7             our $VERSION = '0.19';
8              
9              
10 3     3   1416 use Role::MethodReturns;
  3         451818  
  3         21  
11              
12 3     3   18196 use OpenTracing::Types qw/SpanContext/;
  3         3770  
  3         33  
13 3     3   1373 use Types::Standard qw/ Str Value HashRef ArrayRef/;
  3         8  
  3         21  
14 3     3   4818 use Types::Common::Numeric qw/PositiveNum/;
  3         65776  
  3         41  
15              
16              
17              
18             around get_context => instance_method ( ) {
19            
20             returns( SpanContext,
21             $original->( $instance => ( ) )
22             )
23            
24             };
25              
26              
27              
28             around overwrite_operation_name => instance_method ( Str $operation_name ) {
29            
30             returns_self( $instance,
31             $original->( $instance => ( $operation_name ) )
32             )
33            
34             };
35              
36              
37              
38             around finish => instance_method ( @time_stamps ) {
39            
40             ( ArrayRef[PositiveNum, 0, 1 ] )->assert_valid( \@time_stamps );
41             #
42             # a bit narly construct, but otherwise we might have accidently introduced
43             # `undef` as an argument, where there used to be none!
44            
45             returns_self( $instance,
46             $original->( $instance => ( @time_stamps ) )
47             )
48            
49             };
50              
51              
52              
53             around set_tag => instance_method ( Str $key, Value $value ) {
54            
55             returns_self( $instance,
56             $original->( $instance => ( $key, $value ) )
57             )
58            
59             };
60              
61              
62              
63             around log_data => instance_method ( @log_data ) {
64            
65             ( HashRef[ Value ] )->assert_valid( { @log_data } );
66            
67             returns_self( $instance,
68             $original->( $instance => ( @log_data ) )
69             )
70            
71             };
72              
73              
74              
75             around set_baggage_item => instance_method ( Str $key, Value $value, ) {
76            
77             returns_self( $instance,
78             $original->( $instance => ( $key, $value ) )
79             )
80            
81             };
82              
83              
84              
85             around get_baggage_item => instance_method ( Str $key ) {
86            
87             returns_maybe ( Value,
88             $original->( $instance => ( $key ) )
89             )
90            
91             };
92              
93              
94              
95             1;