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
icon/buttons/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
icon/buttons/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");
    }
}