Releases: fabfuel/prophiler
PHP 7 Support (No PHP 5.4 support anymore)
New Features
- PHP 7.0 and 7.1 support
Changes
- BREAKING: Removed PHP 5.4 support
- Removed composer.lock
- Removed demo page from the library repository (moved to https://github.com/fabfuel/prophiler-demo)
Fixes
- Fixed trailing
- Convert special characters to HTML entities
Aggregations
New Features
- Aggregations
- Phalcon Cache Backend Decorator
- ElasticSearch Client Decorator
- Automatic EventsManger registration
Changes
- internally handling all durations in milliseconds (instead of seconds)
- Docker config improvements
Aggregations
Prophiler now features benchmark aggregations. These give you a lot more insights and are extremely useful to:
- quickly see the total number of recurring executions (e.g. database or cache queries)
- analyze minimum, maximum and average execution times of recurring executions
- easily see (e.g. accidentally) recurring executions of the same database query
- get a warning, if the total number of executions exceeds a custom threshold
- get a warning, if the maximum execution time exceeds a custom threshold
Setup
Prophiler comes with some aggregators, but you can easily create your own. To Set up an aggregator, all you need to do is to register the aggregator at the profiler instance:
$profiler->addAggregator(new \Fabfuel\Prophiler\Aggregator\Database\QueryAggregator());
$profiler->addAggregator(new \Fabfuel\Prophiler\Aggregator\Cache\CacheAggregator());
That's it. You immediately see all database and cache queries, grouped by command/query, including the total number of executions, the total duration of all executions as well as the minimum, maximum and average execution time.
Phalcon Cache Backend Decorator
To profile Phalcon cache backend requests, you only need to decorate the cache backend with the BackendDecorator. It will benchmark all cache operations automatically. Here is an example with the APC backend:
$cacheFrontend = new \Phalcon\Cache\Frontend\Data(['lifetime' => 172800]);
$cacheBackend = new \Phalcon\Cache\Backend\Apc($cacheFrontend, ['prefix' => 'app-data']);
$cache = \Fabfuel\Prophiler\Decorator\Phalcon\Cache\BackendDecorator($cacheBackend, $profiler);
ElasticSearch Client Decorator
To profile Elasticsearch requests, you only need to decorate the Elasticsearch client with the ClientDecorator:
$elasticsearch = new Elasticsearch\Client(['your' => 'config']);
$client = new \Fabfuel\Prophiler\Decorator\Elasticsearch\ClientDecorator($client, $profiler);
Automatic EventsManger registration
Prophiler now uses existing EventsManagers when attaching the Db, Dispatcher and View plugins and uses the default one as fallback, if no EventsManager is defined.