line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package NewRelic::Agent::FFI::Procedural; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
234611
|
use strict; |
|
4
|
|
|
|
|
15
|
|
|
4
|
|
|
|
|
127
|
|
4
|
4
|
|
|
4
|
|
49
|
use warnings; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
110
|
|
5
|
4
|
|
|
4
|
|
72
|
use 5.010; |
|
4
|
|
|
|
|
14
|
|
6
|
4
|
|
|
4
|
|
22
|
use base qw( Exporter ); |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
438
|
|
7
|
4
|
|
|
4
|
|
28
|
use constant NEWRELIC_RETURN_CODE_OK => 0; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
356
|
|
8
|
4
|
|
|
4
|
|
45
|
use constant NEWRELIC_RETURN_CODE_OTHER => -0x10001; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
218
|
|
9
|
4
|
|
|
4
|
|
23
|
use constant NEWRELIC_RETURN_CODE_DISABLED => -0x20001; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
234
|
|
10
|
4
|
|
|
4
|
|
26
|
use constant NEWRELIC_RETURN_CODE_INVALID_PARAM => -0x30001; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
217
|
|
11
|
4
|
|
|
4
|
|
25
|
use constant NEWRELIC_RETURN_CODE_INVALID_ID => -0x30002; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
236
|
|
12
|
4
|
|
|
4
|
|
26
|
use constant NEWRELIC_RETURN_CODE_TRANSACTION_NOT_STARTED => -0x40001; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
221
|
|
13
|
4
|
|
|
4
|
|
26
|
use constant NEWRELIC_RETURN_CODE_TRANSACTION_IN_PROGRESS => -0x40002; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
223
|
|
14
|
4
|
|
|
4
|
|
26
|
use constant NEWRELIC_RETURN_CODE_TRANSACTION_NOT_NAMED => -0x40003; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
189
|
|
15
|
4
|
|
|
4
|
|
22
|
use constant NEWRELIC_ROOT_SEGMENT => 0; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
212
|
|
16
|
4
|
|
|
4
|
|
49
|
use constant NEWRELIC_AUTOSCOPE => 1; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
204
|
|
17
|
4
|
|
|
4
|
|
22
|
use constant NEWRELIC_STATUS_CODE_SHUTDOWN => 0; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
187
|
|
18
|
4
|
|
|
4
|
|
24
|
use constant NEWRELIC_STATUS_CODE_STARTING => 1; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
205
|
|
19
|
4
|
|
|
4
|
|
24
|
use constant NEWRELIC_STATUS_CODE_STOPPING => 2; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
192
|
|
20
|
4
|
|
|
4
|
|
23
|
use constant NEWRELIC_STATUS_CODE_STARTED => 3; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
744
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# ABSTRACT: Procedural interface for NewRelic APM |
23
|
|
|
|
|
|
|
our $VERSION = '0.08'; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub newrelic_init |
27
|
|
|
|
|
|
|
{ |
28
|
3
|
|
|
3
|
1
|
27953
|
return NEWRELIC_RETURN_CODE_OK; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my $id = 1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub newrelic_transaction_begin |
36
|
|
|
|
|
|
|
{ |
37
|
4
|
|
|
4
|
1
|
1467
|
return $id++; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
foreach my $func (qw( newrelic_transaction_set_name newrelic_transaction_set_request_url |
41
|
|
|
|
|
|
|
newrelic_transaction_set_max_trace_segments newrelic_transaction_set_category |
42
|
|
|
|
|
|
|
newrelic_transaction_set_type_web newrelic_transaction_set_type_other |
43
|
|
|
|
|
|
|
newrelic_transaction_add_attribute newrelic_transaction_notice_error |
44
|
|
|
|
|
|
|
newrelic_transaction_end newrelic_record_metric newrelic_record_cpu_usage |
45
|
|
|
|
|
|
|
newrelic_record_memory_usage )) |
46
|
|
|
|
|
|
|
{ |
47
|
20
|
|
|
20
|
|
698
|
state $sub = sub { return NEWRELIC_RETURN_CODE_OK }; |
48
|
4
|
|
|
4
|
|
30
|
no strict 'refs'; |
|
4
|
|
|
|
|
37
|
|
|
4
|
|
|
|
|
602
|
|
49
|
|
|
|
|
|
|
*$func = $sub; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub newrelic_segment_generic_begin |
53
|
|
|
|
|
|
|
{ |
54
|
1
|
|
|
1
|
1
|
3
|
return $id++; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub newrelic_segment_datastore_begin |
59
|
|
|
|
|
|
|
{ |
60
|
2
|
|
|
2
|
1
|
8987
|
$id++; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub newrelic_segment_external_begin |
65
|
|
|
|
|
|
|
{ |
66
|
1
|
|
|
1
|
1
|
4
|
$id++; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub newrelic_segment_end |
70
|
|
|
|
|
|
|
{ |
71
|
4
|
|
|
4
|
1
|
462
|
return NEWRELIC_RETURN_CODE_OK; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub newrelic_register_message_handler |
76
|
|
|
|
|
|
|
{ |
77
|
1
|
|
|
1
|
1
|
3
|
return; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
4
|
|
|
4
|
|
30
|
use constant newrelic_message_handler => 0xdeadbeaf; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
226
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
4
|
|
|
4
|
|
27
|
use constant newrelic_basic_literal_replacement_obfuscator => 0xbeafdead; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
601
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub newrelic_request_shutdown |
87
|
|
|
|
|
|
|
{ |
88
|
1
|
|
|
1
|
1
|
2145
|
return NEWRELIC_RETURN_CODE_OK; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub newrelic_enable_instrumentation |
93
|
|
|
|
|
|
|
{ |
94
|
0
|
|
|
0
|
1
|
|
return; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
our @EXPORT = sort grep /^newrelic_/i, keys %NewRelic::Agent::FFI::Procedural::; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
1; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
__END__ |