atatus_add_custom_layer()
function can be used for your custom functions. For instance, if you want to know the response time of the transactions you have written, you can use this function.
Compatibility
Compatible with all PHP agent versions.
Syntax
copy
atatus_add_custom_layer($function_name)
Parameter
Parameter | Type | Description |
---|---|---|
$function_name | String (Required) | Name of the function or ClassName::method to be instrumented. |
Examples
copy
<?php
function example_function() {
if (extension_loaded('atatus')) { // Ensure PHP agent is available
atatus_add_custom_layer("function_name");
}
// OR
if (extension_loaded('atatus')) {
atatus_add_custom_layer("SampleClass::some_method");
}
}