Measure PHP background operation performance using the simple function offered by Atatus PHP APM. Sign up with Atatus and get an instant demo for free!
To capture a background transaction, utilize the function atatus_set_background_transaction(true) along with atatus_begin_transaction() and atatus_end_transaction()
Compatibility
Requires PHP agent version 1.15.2 or higher.
Syntax
atatus_set_background_transaction($value)
Parameter
Parameter
Type
Description
$value
Boolean (Required)
Set true for background transaction.
Example
<?phpfunction migrate() { if (extension_loaded('atatus')) { // ensure PHP agent is available atatus_begin_transaction(); //begins a new transaction atatus_set_background_transaction(true); } // Your background task... if (extension_loaded('atatus')) { // ensure PHP agent is available atatus_end_transaction(); // stops the current transaction }}