comodojo / dispatcher.plugin.performer
Service performance plugin for comodojo/dispatcher.framework
Installs: 106
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:dispatcher-plugin
This package is auto-updated.
Last update: 2024-11-05 18:18:49 UTC
README
A service performance plugin for comodojo/dispatcher.framework.
If enabled, this plugin will inject 4 different headers in a service response:
- D-Request-Sec: time spent by framework to model request
- D-Route-Sec: routing time
- D-Result-Sec: service execution time
- D-Total-Sec: total time, from request to response
Values are calculated in microseconds.
Installation
Just require lib in a dispatcher.project installation (current version: 1.0.0):
composer require comodojo/dispatcher.plugin.performer 1.0.*
Usage
To enable performer in a single service, add 'perform' => true
into service parameters (routing-config.php), like:
$dispatcher->setRoute( "test_performance", "ROUTE", "performed.php", array ( 'perform' => true ) );
To enable performer for all services, add DISPATCHER_PERFORM_EVERYTHING
constant into dispatcher-config.php file:
define('DISPATCHER_PERFORM_EVERYTHING', true);
Demo
Dispatcher test environment contains a "Dispatcher performance" case.
Test environment is also available on the online demo.