comodojo/dispatcher.plugin.performer

Service performance plugin for comodojo/dispatcher.framework

1.0.0 2014-08-03 13:44 UTC

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.