| 1 | package OpenTracing::Process; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 11 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 11 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 11 | our $VERSION = '1.006'; # VERSION | |||||||||||||||||||
| 7 | 11 | our $AUTHORITY = 'cpan:TEAM'; # AUTHORITY | |||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 11 | ▶ | use parent qw(OpenTracing::Common); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 11 | ▶ | no indirect; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | 11 | ▶ | use utf8; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | =encoding utf8 | ||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | =head1 NAME | ||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | OpenTracing::Process - information about a single process | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | =head1 DESCRIPTION | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | Each batch of spans is linked to a process. This can either be a Unix-style process or a more abstract "service" | ||||||||||||||||||||
| 23 | concept. | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | =cut | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | =head1 METHODS | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | =head2 pid | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | The process pid. | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | =cut | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 0 | ▶ | sub pid { shift->{pid} //= $$ } | ||||||||||||||||||
|
Subroutine
pid: not called CC=2 SCAR=17.9
Pod
documented
Condition0%0/3
+(shift())->{"pid"} //= $$
MC/DC0%0/2
+(shift())->{"pid"} //= $$
+(shift())->{"pid"}
$$
Truth table0%0/3
A //= B
A= +(shift())->{"pid"}B= $$
| |||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | =head2 name | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | The process name. Freeform text string. | ||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | =cut | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | 0 | ▶ | sub name { shift->{name} //= "$0" } | ||||||||||||||||||
|
Subroutine
name: not called CC=2 SCAR=17.9
Pod
documented
Condition0%0/2
+(shift())->{"name"} //= "$0"
MC/DC0%0/1
+(shift())->{"name"} //= "$0"
+(shift())->{"name"}
Truth table0%0/2
A
A= +(shift())->{"name"}
| |||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | =head2 tags | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | Arrayref of tags relating to the process. | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | =cut | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | 0 | ▶ | sub tags { shift->{tags} } | ||||||||||||||||||
|
Subroutine
tags: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | =head2 tag_list | ||||||||||||||||||||
| 54 | |||||||||||||||||||||
| 55 | List of tags for this process. | ||||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | =cut | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 0 | ▶ | sub tag_list { | ||||||||||||||||||
|
Subroutine
tag_list: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 60 | 0 | ▶ | (shift->{tags} //= [])->@* | ||||||||||||||||||
|
Condition0%0/2
+(shift())->{"tags"} //= []
MC/DC0%0/1
+(shift())->{"tags"} //= []
+(shift())->{"tags"}
Truth table0%0/2
A
A= +(shift())->{"tags"}
| |||||||||||||||||||||
| 61 | } | ||||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | 0 | ▶ | sub tag : method { | ||||||||||||||||||
|
Subroutine
tag: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 64 | 0 | my ($self, %args) = @_; | |||||||||||||||||||
| 65 | 0 | @{$self->{tags}}{keys %args} = values %args; | |||||||||||||||||||
| 66 | 0 | return $self; | |||||||||||||||||||
| 67 | } | ||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | 11 | 1; | |||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | __END__ | ||||||||||||||||||||