| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
4
|
|
|
4
|
|
165470
|
use Object::Pad ':experimental(init_expr)'; |
|
|
4
|
|
|
|
|
10084
|
|
|
|
4
|
|
|
|
|
56
|
|
|
2
|
|
|
|
|
|
|
# ABSTRACT: A composite sampler |
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package OpenTelemetry::SDK::Trace::Sampler::ParentBased; |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.028'; |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
class OpenTelemetry::SDK::Trace::Sampler::ParentBased |
|
9
|
|
|
|
|
|
|
:does(OpenTelemetry::SDK::Trace::Sampler) |
|
10
|
1
|
|
|
1
|
|
707
|
{ |
|
|
1
|
|
|
|
|
5
|
|
|
|
1
|
|
|
|
|
124
|
|
|
11
|
4
|
|
|
4
|
|
1834
|
use OpenTelemetry::Trace; |
|
|
4
|
|
|
|
|
72815
|
|
|
|
4
|
|
|
|
|
153
|
|
|
12
|
4
|
|
|
4
|
|
443
|
use OpenTelemetry::SDK::Trace::Sampler::AlwaysOff; |
|
|
4
|
|
|
|
|
19
|
|
|
|
4
|
|
|
|
|
158
|
|
|
13
|
4
|
|
|
4
|
|
489
|
use OpenTelemetry::SDK::Trace::Sampler::AlwaysOn; |
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
2781
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
field $root :param; |
|
16
|
|
|
|
|
|
|
field $remote_parent_sampled :param //= OpenTelemetry::SDK::Trace::Sampler::AlwaysOn->new; |
|
17
|
|
|
|
|
|
|
field $remote_parent_not_sampled :param //= OpenTelemetry::SDK::Trace::Sampler::AlwaysOff->new; |
|
18
|
|
|
|
|
|
|
field $local_parent_sampled :param //= OpenTelemetry::SDK::Trace::Sampler::AlwaysOn->new; |
|
19
|
|
|
|
|
|
|
field $local_parent_not_sampled :param //= OpenTelemetry::SDK::Trace::Sampler::AlwaysOff->new; |
|
20
|
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
1
|
2
|
method description () { |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
2
|
|
|
22
|
1
|
|
|
|
|
6
|
sprintf 'ParentBased{root=%s,remote_parent_sampled=%s,remote_parent_not_sampled=%s,local_parent_sampled=%s,local_parent_not_sampled=%s}', |
|
23
|
|
|
|
|
|
|
map $_->description, |
|
24
|
|
|
|
|
|
|
$root, |
|
25
|
|
|
|
|
|
|
$remote_parent_sampled, |
|
26
|
|
|
|
|
|
|
$remote_parent_not_sampled, |
|
27
|
|
|
|
|
|
|
$local_parent_sampled, |
|
28
|
|
|
|
|
|
|
$local_parent_not_sampled; |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
9
|
|
|
9
|
1
|
29374
|
method should_sample (%args) { |
|
|
9
|
|
|
|
|
39
|
|
|
|
9
|
|
|
|
|
19
|
|
|
|
9
|
|
|
|
|
10
|
|
|
32
|
|
|
|
|
|
|
my $span_context = OpenTelemetry::Trace |
|
33
|
9
|
|
|
|
|
65
|
->span_from_context($args{context})->context; |
|
34
|
|
|
|
|
|
|
|
|
35
|
9
|
|
|
|
|
10300
|
my $sampled = $span_context->trace_flags->sampled; |
|
36
|
|
|
|
|
|
|
|
|
37
|
9
|
100
|
|
|
|
9287
|
my $delegate = !$span_context->valid |
|
|
|
100
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
? $root |
|
39
|
|
|
|
|
|
|
: $span_context->remote |
|
40
|
|
|
|
|
|
|
? $sampled |
|
41
|
|
|
|
|
|
|
? $remote_parent_sampled |
|
42
|
|
|
|
|
|
|
: $remote_parent_not_sampled |
|
43
|
|
|
|
|
|
|
: $sampled |
|
44
|
|
|
|
|
|
|
? $local_parent_sampled |
|
45
|
|
|
|
|
|
|
: $local_parent_not_sampled; |
|
46
|
|
|
|
|
|
|
|
|
47
|
9
|
|
|
|
|
6527
|
$delegate->should_sample(%args); |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
} |