suora/apm-wrapper

This is a wrapper for APMs in PHP

Fund package maintenance!
SuoraGmbH

v1.0.0 2023-07-14 11:57 UTC

README

68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f737570706f72742d756b7261696e652e7376673f743d31

This is a wrapper for APMs in PHP

Latest Version on Packagist Tests Total Downloads

Most APMs in the PHP ecosystem automatically track requests and errors. However, if you implement background jobs, you might need to manually track them, especially if one PHP process runs multiple jobs. This project might help you. :)

This package is work in progress and might never be production ready.

Installation

You can install the package via composer:

composer require suora/apm-wrapper

Usage

$profiler = new \Suora\ApmWrapper\Profiler\AutoTideways(
    'your-token',
    'workerpool'
);

foreach ($jobs as $job) {
    $profiler->startTransaction($job->getName());
    $profiler->addParameter('jobId', $job->getId());

    $job->run();

    $profiler->endTransaction();
}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.