public function testEndTransaction() { $ignore = false; $handler = $this->getHandlerSpy('newrelic_end_transaction', array($ignore)); $agent = new Newrelic(false, $handler); $this->assertNull($agent->endTransaction($ignore)); }
/** * Despite being similar in name to newrelic_end_of_transaction above, this call serves a very different purpose. * * newrelic_end_of_transaction simply marks the end time of the transaction but takes no other action. The * transaction is still only sent to the daemon when the PHP engine determines that the script is done executing and * is shutting down. This function on the other hand, causes the current transaction to end immediately, and will * ship all of the metrics gathered thus far to the daemon unless the ignore parameter is set to true. In effect * this call simulates what would happen when PHP terminates the current transaction. This is most commonly used in * command line scripts that do some form of job queue processing. You would use this call at the end of processing * a single job task, and begin a new transaction (see below) when a new task is pulled off the queue. * * Normally, when you end a transaction you want the metrics that have been gathered thus far to be recorded. * However, there are times when you may want to end a transaction without doing so. In this case use the second * form of the function and set ignore to true. * * @param bool $ignore * @return mixed * @static */ public static function endTransaction($ignore = false) { return \Intouch\Newrelic\Newrelic::endTransaction($ignore); }