NAME

Net::NewRelic - Perl extension the NewRelic Agent SDK

SYNOPSIS

use Net::NewRelic;
my $nr = Net::NewRelic->new();
$nr->name("some name");
$nr->url("/path/to/my/file.cgi");
$nr->attribute("userid", $user->id);

{ #Work #1
  my $s = $nr->segment("Do work #1");
  [...]
}
{ #Work #2
  my $s = $nr->segment("Do work #2");
  [...]
  
  { # Work #2.1
    my $ss = $s->segment("Do Work #2.1");
    [...]
  }
}
{ #DB Work
  my $s = $nr->data_segment("table","select");
  [...]
}

DESCRIPTION

This module allows you to report timing information to NewRelic.

Each segment you create will capture timing information until the object comes out of scope.

NOTE

For this module to work, you need to ensure there is a running copy of newrelic-collector-client-daemon on the same system as this code is running.

export NEWRELIC_LICENSE_KEY=abcdef1234567890
export NEWRELIC_APP_NAME=some-application-name
export NEWRELIC_APP_LANGUAGE=perl
export NEWRELIC_APP_LANGUAGE_VERSION=5.5

export LD_LIBRARY_PATH=/opt/newrelic/lib

/opt/newrelic/bin/newrelic-collector-client-daemon

SEE ALSO

https://docs.newrelic.com/docs/features/agent-sdk

AUTHOR

Philippe M. Chiasson, <gozer@localdomain>

COPYRIGHT AND LICENSE

Copyright (C) 2014 by Philippe M. Chiasson

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.18.2 or, at your option, any later version of Perl 5 you may have available.