2017 © Pedro Peláez
 

library psr15-benchmark

Benchmark for middleware app

image

enderlab/psr15-benchmark

Benchmark for middleware app

  • Wednesday, September 20, 2017
  • by ender9108
  • Repository
  • 0 Watchers
  • 0 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

psr15-benchmark

Build Status Coverage Status Latest Stable Version Total Downloads License, (*1)

Get started

<?php
use \EnderLab\BenchmarkMiddleware;

$app->pipe(BenchmarkMiddleware::getInstance(
    BenchmarkMiddleware::START_TAG,
    [
        'benchmark.time.format'     => [
            'format'                => TimeFormatter::SECOND,
            'precision'             => 2
        ],
        'benchmark.date.format'     => 'Y-m-d',
        'benchmark.datetime.format' => 'Y-m-d H:i:s',
        'benchmark.byte.precision'  => 2,
        'benchmark.logger'          => [
            'instance'              => new Logger('test'), /* LoggerInterface default null */
            'log_level'             => LogLevel::DEBUG     /* default LogLevel::DEBUG */
        ],
        'benchmark.formatter'       => [
            'instance'              => 'EnderLab\\Benchmark\\Formatter\\DefaultMessageFormatter',
            'template'              => '{{{DATETIME}}} - time : {{{TIME}}} - memory : {{{MEMORY}}} (peak {{{MEMORY_PEAK}}})'
        ]
    ]
));
$app->pipe(/* Other middleware */);
$app->pipe(BenchmarkMiddleware::getInstance('FLAG1'));
$app->pipe(/* Other middleware */);
$app->pipe(/* Other middleware */);
$app->pipe(BenchmarkMiddleware::getInstance(
    BenchmarkMiddleware::END_TAG
));

The Versions