Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (18 sloc) 893 Bytes

Operation Runners

If you are using Tolerance's operation runners you can decorate them with some additional operation runner that will publish some metrics. It's an easy way to collect metrics from your application with almost no effort.

Success/Failure

This operation runner will increment a :.failure and a :.success metric at every run. You can therefore count the number of ran operation as well as their status.

use Tolerance\Operation\Runner\Metrics\SuccessFailurePublisherOperationRunner;

$runner = new SuccessFailurePublisherOperationRunner(
    $decoratedRunner,
    $metricPublisher,
    'metric_namespace'
);

Note

You can also uses Symfony's bridge to create and use this runner without any PHP code.