| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package NewRelic::Agent::FFI::Procedural; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 4 |  |  | 4 |  | 208116 | use strict; | 
|  | 4 |  |  |  |  | 13 |  | 
|  | 4 |  |  |  |  | 113 |  | 
| 4 | 4 |  |  | 4 |  | 20 | use warnings; | 
|  | 4 |  |  |  |  | 9 |  | 
|  | 4 |  |  |  |  | 87 |  | 
| 5 | 4 |  |  | 4 |  | 63 | use 5.010; | 
|  | 4 |  |  |  |  | 15 |  | 
| 6 | 4 |  |  | 4 |  | 20 | use base qw( Exporter ); | 
|  | 4 |  |  |  |  | 8 |  | 
|  | 4 |  |  |  |  | 444 |  | 
| 7 | 4 |  |  | 4 |  | 30 | use constant NEWRELIC_RETURN_CODE_OK                      => 0; | 
|  | 4 |  |  |  |  | 9 |  | 
|  | 4 |  |  |  |  | 316 |  | 
| 8 | 4 |  |  | 4 |  | 26 | use constant NEWRELIC_RETURN_CODE_OTHER                   => -0x10001; | 
|  | 4 |  |  |  |  | 8 |  | 
|  | 4 |  |  |  |  | 195 |  | 
| 9 | 4 |  |  | 4 |  | 23 | use constant NEWRELIC_RETURN_CODE_DISABLED                => -0x20001; | 
|  | 4 |  |  |  |  | 7 |  | 
|  | 4 |  |  |  |  | 221 |  | 
| 10 | 4 |  |  | 4 |  | 25 | use constant NEWRELIC_RETURN_CODE_INVALID_PARAM           => -0x30001; | 
|  | 4 |  |  |  |  | 8 |  | 
|  | 4 |  |  |  |  | 201 |  | 
| 11 | 4 |  |  | 4 |  | 23 | use constant NEWRELIC_RETURN_CODE_INVALID_ID              => -0x30002; | 
|  | 4 |  |  |  |  | 9 |  | 
|  | 4 |  |  |  |  | 194 |  | 
| 12 | 4 |  |  | 4 |  | 27 | use constant NEWRELIC_RETURN_CODE_TRANSACTION_NOT_STARTED => -0x40001; | 
|  | 4 |  |  |  |  | 9 |  | 
|  | 4 |  |  |  |  | 205 |  | 
| 13 | 4 |  |  | 4 |  | 25 | use constant NEWRELIC_RETURN_CODE_TRANSACTION_IN_PROGRESS => -0x40002; | 
|  | 4 |  |  |  |  | 8 |  | 
|  | 4 |  |  |  |  | 221 |  | 
| 14 | 4 |  |  | 4 |  | 43 | use constant NEWRELIC_RETURN_CODE_TRANSACTION_NOT_NAMED   => -0x40003; | 
|  | 4 |  |  |  |  | 11 |  | 
|  | 4 |  |  |  |  | 188 |  | 
| 15 | 4 |  |  | 4 |  | 30 | use constant NEWRELIC_ROOT_SEGMENT => 0; | 
|  | 4 |  |  |  |  | 9 |  | 
|  | 4 |  |  |  |  | 194 |  | 
| 16 | 4 |  |  | 4 |  | 26 | use constant NEWRELIC_AUTOSCOPE    => 1; | 
|  | 4 |  |  |  |  | 8 |  | 
|  | 4 |  |  |  |  | 184 |  | 
| 17 | 4 |  |  | 4 |  | 23 | use constant NEWRELIC_STATUS_CODE_SHUTDOWN => 0; | 
|  | 4 |  |  |  |  | 26 |  | 
|  | 4 |  |  |  |  | 203 |  | 
| 18 | 4 |  |  | 4 |  | 26 | use constant NEWRELIC_STATUS_CODE_STARTING => 1; | 
|  | 4 |  |  |  |  | 10 |  | 
|  | 4 |  |  |  |  | 238 |  | 
| 19 | 4 |  |  | 4 |  | 25 | use constant NEWRELIC_STATUS_CODE_STOPPING => 2; | 
|  | 4 |  |  |  |  | 10 |  | 
|  | 4 |  |  |  |  | 192 |  | 
| 20 | 4 |  |  | 4 |  | 24 | use constant NEWRELIC_STATUS_CODE_STARTED  => 3; | 
|  | 4 |  |  |  |  | 10 |  | 
|  | 4 |  |  |  |  | 721 |  | 
| 21 |  |  |  |  |  |  |  | 
| 22 |  |  |  |  |  |  | # ABSTRACT: Procedural interface for NewRelic APM | 
| 23 |  |  |  |  |  |  | our $VERSION = '0.08'; | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  |  | 
| 26 |  |  |  |  |  |  | sub newrelic_init | 
| 27 |  |  |  |  |  |  | { | 
| 28 | 3 |  |  | 3 | 1 | 27283 | return NEWRELIC_RETURN_CODE_OK; | 
| 29 |  |  |  |  |  |  | } | 
| 30 |  |  |  |  |  |  |  | 
| 31 |  |  |  |  |  |  |  | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  | my $id = 1; | 
| 34 |  |  |  |  |  |  |  | 
| 35 |  |  |  |  |  |  | sub newrelic_transaction_begin | 
| 36 |  |  |  |  |  |  | { | 
| 37 | 4 |  |  | 4 | 1 | 1460 | 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 |  | 649 | state $sub = sub { return NEWRELIC_RETURN_CODE_OK }; | 
| 48 | 4 |  |  | 4 |  | 39 | no strict 'refs'; | 
|  | 4 |  |  |  |  | 38 |  | 
|  | 4 |  |  |  |  | 517 |  | 
| 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 | 27558 | $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 | 430 | 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 |  | 29 | use constant newrelic_message_handler => 0xdeadbeaf; | 
|  | 4 |  |  |  |  | 7 |  | 
|  | 4 |  |  |  |  | 221 |  | 
| 81 |  |  |  |  |  |  |  | 
| 82 |  |  |  |  |  |  |  | 
| 83 | 4 |  |  | 4 |  | 25 | use constant newrelic_basic_literal_replacement_obfuscator => 0xbeafdead; | 
|  | 4 |  |  |  |  | 8 |  | 
|  | 4 |  |  |  |  | 526 |  | 
| 84 |  |  |  |  |  |  |  | 
| 85 |  |  |  |  |  |  |  | 
| 86 |  |  |  |  |  |  | sub newrelic_request_shutdown | 
| 87 |  |  |  |  |  |  | { | 
| 88 | 1 |  |  | 1 | 1 | 2085 | 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__ |