line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package NewFangle::CustomEvent 0.0901 { |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
38
|
use strict; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
166
|
|
4
|
6
|
|
|
6
|
|
25
|
use warnings; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
132
|
|
5
|
6
|
|
|
6
|
|
99
|
use 5.014; |
|
6
|
|
|
|
|
17
|
|
6
|
6
|
|
|
6
|
|
28
|
use NewFangle::FFI; |
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
483
|
|
7
|
6
|
|
|
6
|
|
57
|
use Carp (); |
|
6
|
|
|
|
|
18
|
|
|
6
|
|
|
|
|
1162
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: NewRelic custom event class |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
$ffi->attach( [ create_custom_event => 'new' ] => ['string'] => 'newrelic_custom_event_t' => sub { |
13
|
|
|
|
|
|
|
my($xsub, undef, $event_type) = @_; |
14
|
|
|
|
|
|
|
my $self = $xsub->($event_type); |
15
|
|
|
|
|
|
|
Carp::croak("unable to create NewFangle::CustomEvent instance, see log for details") unless defined $self; |
16
|
|
|
|
|
|
|
$self; |
17
|
|
|
|
|
|
|
}); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$ffi->attach( [ "custom_event_add_attribute_$_" => "add_attribute_$_" ] => [ 'newrelic_custom_event_t', 'string', $_ ] => 'bool' ) |
21
|
|
|
|
|
|
|
for qw( int long double string ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
$ffi->attach( [ discard_custom_event => 'DESTROY' ] => ['opaque*'] => 'bool' => sub { |
24
|
|
|
|
|
|
|
my($xsub, $self) = @_; |
25
|
|
|
|
|
|
|
my $ptr = $$self; |
26
|
|
|
|
|
|
|
$xsub->(\$ptr) if $ptr; |
27
|
|
|
|
|
|
|
}); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
}; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |