line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package NewFangle::FFI 0.07 { |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
259366
|
use strict; |
|
8
|
|
|
|
|
30
|
|
|
8
|
|
|
|
|
314
|
|
4
|
8
|
|
|
8
|
|
42
|
use warnings; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
202
|
|
5
|
8
|
|
|
8
|
|
138
|
use 5.014; |
|
8
|
|
|
|
|
28
|
|
6
|
8
|
|
|
8
|
|
4153
|
use FFI::CheckLib 0.27 (); |
|
8
|
|
|
|
|
22934
|
|
|
8
|
|
|
|
|
310
|
|
7
|
8
|
|
|
8
|
|
5769
|
use FFI::Platypus 1.26; |
|
8
|
|
|
|
|
54670
|
|
|
8
|
|
|
|
|
300
|
|
8
|
8
|
|
|
8
|
|
4170
|
use FFI::C 0.08; |
|
8
|
|
|
|
|
25087
|
|
|
8
|
|
|
|
|
294
|
|
9
|
8
|
|
|
8
|
|
68
|
use base qw( Exporter ); |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
5548
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT = qw( $ffi ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# ABSTRACT: Private class for NewFangle.pm |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _lib { |
17
|
9
|
|
|
9
|
|
1016
|
my $lib = FFI::CheckLib::find_lib lib => 'newrelic'; |
18
|
9
|
50
|
|
|
|
75189
|
$lib |
19
|
|
|
|
|
|
|
? $lib |
20
|
|
|
|
|
|
|
: FFI::CheckLib::find_lib lib => 'newrelic', alien => 'Alien::libnewrelic' |
21
|
|
|
|
|
|
|
; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
our $ffi = FFI::Platypus->new( |
26
|
|
|
|
|
|
|
api => 1, |
27
|
|
|
|
|
|
|
lib => [_lib], |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
$ffi->mangler(sub { "newrelic_$_[0]" }); |
30
|
|
|
|
|
|
|
$ffi->load_custom_type('::PtrObject', 'newrelic_segment_t', 'NewFangle::Segment', |
31
|
|
|
|
|
|
|
sub { bless { ptr => $_[0] }, 'NewFangle::Segment' }); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
$ffi->type('uint64' => 'newrelic_time_us_t'); |
34
|
|
|
|
|
|
|
$ffi->type('object(NewFangle::App)' => 'newrelic_app_t'); |
35
|
|
|
|
|
|
|
$ffi->type('object(NewFangle::Transaction)' => 'newrelic_txn_t',); |
36
|
|
|
|
|
|
|
$ffi->type('object(NewFangle::CustomEvent)' => 'newrelic_custom_event_t'); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
FFI::C->ffi($ffi); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
package NewFangle::NewrelicLoglevel 0.07 { |
41
|
|
|
|
|
|
|
FFI::C->enum([ |
42
|
|
|
|
|
|
|
'error', |
43
|
|
|
|
|
|
|
'warning', |
44
|
|
|
|
|
|
|
'info', |
45
|
|
|
|
|
|
|
'debug', |
46
|
|
|
|
|
|
|
], { prefix => 'NEWRELIC_LOG_' }); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
package NewFangle::NewrelicTransactionTracerThreshold 0.07 { |
50
|
|
|
|
|
|
|
FFI::C->enum([ |
51
|
|
|
|
|
|
|
'is_apdex_failing', |
52
|
|
|
|
|
|
|
'is_over_duration', |
53
|
|
|
|
|
|
|
], { prefix => 'NEWRELIC_THRESHOLD_' }); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
package NewFangle::NewrelicTtRecordsql 0.07 { |
57
|
|
|
|
|
|
|
FFI::C->enum([ |
58
|
|
|
|
|
|
|
'off', |
59
|
|
|
|
|
|
|
'raw', |
60
|
|
|
|
|
|
|
'obfuscated', |
61
|
|
|
|
|
|
|
], { prefix => 'NEWRELIC_SQL_' }); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
package NewFangle::DatastoreReporting 0.07 { |
65
|
|
|
|
|
|
|
FFI::C->struct([ |
66
|
|
|
|
|
|
|
enabled => 'bool', |
67
|
|
|
|
|
|
|
record_sql => 'newrelic_tt_recordsql_t', |
68
|
|
|
|
|
|
|
threshold_us => 'newrelic_time_us_t', |
69
|
|
|
|
|
|
|
]); |
70
|
|
|
|
|
|
|
}; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
package NewFangle::NewrelicTransactionTracerConfig 0.07 { |
73
|
|
|
|
|
|
|
FFI::C->struct([ |
74
|
|
|
|
|
|
|
enabled => 'bool', |
75
|
|
|
|
|
|
|
threshold => 'newrelic_transaction_tracer_threshold_t', |
76
|
|
|
|
|
|
|
duration_us => 'newrelic_time_us_t', |
77
|
|
|
|
|
|
|
stack_trace_threshold_us => 'newrelic_time_us_t', |
78
|
|
|
|
|
|
|
datastore_reporting => 'datastore_reporting_t', |
79
|
|
|
|
|
|
|
]); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
package NewFangle::NewrelicDatastoreSegmentConfig 0.07 { |
83
|
|
|
|
|
|
|
FFI::C->struct([ |
84
|
|
|
|
|
|
|
instance_reporting => 'bool', |
85
|
|
|
|
|
|
|
database_name_reporting => 'bool', |
86
|
|
|
|
|
|
|
]); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
package NewFangle::NewrelicDistributedTracingConfig 0.07 { |
90
|
|
|
|
|
|
|
FFI::C->struct([ |
91
|
|
|
|
|
|
|
enabled => 'bool', |
92
|
|
|
|
|
|
|
]); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
package NewFangle::NewrelicSpanEventConfig 0.07 { |
96
|
|
|
|
|
|
|
FFI::C->struct([ |
97
|
|
|
|
|
|
|
enabled => 'bool', |
98
|
|
|
|
|
|
|
]); |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
package NewFangle::NewrelicAppConfig 0.07 { |
102
|
|
|
|
|
|
|
FFI::C->struct([ |
103
|
|
|
|
|
|
|
app_name => 'string(255)', |
104
|
|
|
|
|
|
|
license_key => 'string(255)', |
105
|
|
|
|
|
|
|
redirect_collector => 'string(100)', |
106
|
|
|
|
|
|
|
log_filename => 'string(512)', |
107
|
|
|
|
|
|
|
log_level => 'newrelic_loglevel_t', |
108
|
|
|
|
|
|
|
transaction_tracer => 'newrelic_transaction_tracer_config_t', |
109
|
|
|
|
|
|
|
datastore_tracer => 'newrelic_datastore_segment_config_t', |
110
|
|
|
|
|
|
|
distributed_tracing => 'newrelic_distributed_tracing_config_t', |
111
|
|
|
|
|
|
|
span_events => 'newrelic_span_event_config_t', |
112
|
|
|
|
|
|
|
], { trim_string => 1 }); |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
}; |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
1; |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
__END__ |