axel-dzhurko/load-analyser

PHP performance tool analyser your script on time, memory usage and db query. Support Laravel and Composer for web, web console and command line interfaces.

This package is auto-updated.

Last update: 2024-03-25 15:02:21 UTC


README

Highlight

  • Support for Laravel framework » Laravel
  • Support interface web, web console and command line
  • Print information about PHP version, max exaction time and max memory
  • Measure time, memory usage and memory peak
  • Switch automatically between interfaces
  • Support PHP version 5.6, 7.0, 7.1, 7.2

Easy to use

// Add namespace at the top
use LoadAnalyser\LoadAnalyser;

// Set measure point
LoadAnalyser::point();

//
// Run test code
//

// Finish all tasks and show test results
LoadAnalyser::results();

Functions

Set measuring point with or without label

LoadAnalyser::point( <optional:label> );

Finish previous measuring point

LoadAnalyser::finish();

Finish all measuring points and return test results

LoadAnalyser::results();

Command line

Run the performance test for the command line

// Normal
$ php your_script.php

// Or live version
$ php your_script.php --live 

Installation

Install with Laravel

Get PHP performance tool by running the Composer command in the command line.

 $ composer require axel-dzhurko/load-analyser

Open your file for the performance test.

// Add namespace at the top
use LoadAnalyser\LoadAnalyser;

// Set measure point
LoadAnalyser::point();

//
// Run test code
//

// Finish all tasks and show test results
LoadAnalyser::results();

Install with Composer

Get PHP performance by running the Composer command in the command line.

 $ composer require AxelDzhurko/LoadAnalyser

Open your file for the performance test.

// Require vender autoload
require_once('../vendor/autoload.php');

// Add namespace at the top
use LoadAnalyser\LoadAnalyser;

// Set measure point
LoadAnalyser::point();

//
// Run test code
//

// Finish all tasks and show test results
LoadAnalyser::results();