line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package NewFangle::CustomEvent 0.07 { |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
61
|
use strict; |
|
7
|
|
|
|
|
24
|
|
|
7
|
|
|
|
|
264
|
|
4
|
7
|
|
|
7
|
|
42
|
use warnings; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
216
|
|
5
|
7
|
|
|
7
|
|
150
|
use 5.014; |
|
7
|
|
|
|
|
27
|
|
6
|
7
|
|
|
7
|
|
47
|
use NewFangle::FFI; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
947
|
|
7
|
7
|
|
|
7
|
|
72
|
use Carp (); |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
1896
|
|
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__ |