Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bvanhoekelen/performance

⏱ 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.
https://github.com/bvanhoekelen/performance

analyzer command-line command-line-tool composer composer-commands database export laravel measure packagist performance performance-analysis performance-testing php php-performance query query-optimization

Last synced: 4 days ago
JSON representation

⏱ 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.

Awesome Lists containing this project

README

        

# ⏱ PHP Performance tool 🛠

[![Hex.pm](https://img.shields.io/hexpm/l/plug.svg?maxAge=2592000&style=flat-square)](https://github.com/bvanhoekelen/performance/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/bvanhoekelen/performance.svg?style=flat-square)](https://github.com/bvanhoekelen/performance/releases)
[![Packagist](https://img.shields.io/packagist/dt/bvanhoekelen/performance.svg?style=flat-square)](https://packagist.org/packages/bvanhoekelen/performance)
[![Github issues](https://img.shields.io/github/issues/bvanhoekelen/performance.svg?style=flat-square)](https://github.com/bvanhoekelen/performance/issues)
[![Travis branch](https://img.shields.io/travis/bvanhoekelen/performance/master.svg?style=flat-square)](https://travis-ci.org/bvanhoekelen/performance)
[![Travis branch](https://img.shields.io/travis/bvanhoekelen/performance/develop.svg?style=flat-square)](https://travis-ci.org/bvanhoekelen/performance) Build: Master|Develop

PHP performance tool

## Highlight
- Measure easily the performance of your PHP script across multiple platforms
- Support for Laravel framework » [Laravel](https://laravel.com)
- Support interface web, web console and command line
- Export results to class, file or json string » [how to use query logging](https://github.com/bvanhoekelen/performance/wiki/Export-handler)
- Print information about PHP version, max exaction time and max memory
- Display current user and process id » [how to display username and process id](https://github.com/bvanhoekelen/performance/wiki/Config-run-information)
- Support multiple points » [how to use multiple points](https://github.com/bvanhoekelen/performance/wiki/Multiple-points)
- Measure time, memory usage and memory peak
- Switch automatically between interfaces
- Log database queries » [how to use query logging](https://github.com/bvanhoekelen/performance/wiki/Config-query-log)
- Live function » [how to use](#command-line)
- Easy to install » [installation](#installation)
- Support PHP version 5.6, 7.0, 7.1, 7.2
- Clearly and active wiki » [Wiki](https://github.com/bvanhoekelen/performance/wiki)
- Love feedback » [backlog](https://github.com/bvanhoekelen/performance/blob/master/BACKLOG.md) or [create issues](https://github.com/bvanhoekelen/performance/issues)

## Easy to use
```php
// Add namespace at the top
use Performance\Performance;

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

//
// Run test code
//

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

```
See the [function overview](https://github.com/bvanhoekelen/performance/wiki/Doc-functions) for more functions.

## Web preview

PHP performance tool for web

## Command line preview

PHP performance tool for command line

See [how to use query logging](https://github.com/bvanhoekelen/performance/wiki/Config-query-log).

## Web console

PHP performance tool with full date review

See [how to use query logging](https://github.com/bvanhoekelen/performance/wiki/Config-query-log).

See [how to export data](https://github.com/bvanhoekelen/performance/wiki/Export-handler).

See [more info over data review](https://github.com/bvanhoekelen/performance/wiki/Config-presenter).

## Functions
Set measuring point with or without label

```php
Performance::point( );
```

Finish previous measuring point

```php
Performance::finish();
```

Finish all measuring points and return test results

```php
Performance::results();
```

See the [function overview](https://github.com/bvanhoekelen/performance/wiki/Doc-functions) for more.

## Command line

Run the performance test for the command line

```php
// Normal
$ php your_script.php

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

# Help, docs and links
- [Wiki](https://github.com/bvanhoekelen/performance/wiki)
- [Config items](https://github.com/bvanhoekelen/performance/wiki/Doc-config)
- [Backlog](https://github.com/bvanhoekelen/performance/blob/master/BACKLOG.md)
- [Change log](https://github.com/bvanhoekelen/performance/blob/master/CHANGELOG.md)
- [Packagist](https://packagist.org/packages/bvanhoekelen/performance)

## Backlog & Feedback
If you have any suggestions to improve this performance tool? Please add your feature, bug or improvement to the [BACKLOG.dm](https://github.com/bvanhoekelen/performance/blob/master/BACKLOG.md). Or create a [issues](https://github.com/bvanhoekelen/performance/issues).
- [Open backlog](https://github.com/bvanhoekelen/performance/blob/master/BACKLOG.md)
- [Create issues](https://github.com/bvanhoekelen/performance/issues)

# Installation

## Install with Laravel
Get PHP performance tool by running the Composer command in the command line.
```{r, engine='bash', count_lines}
$ composer require bvanhoekelen/performance
```

Open your file for the performance test.
```php
// Add namespace at the top
use Performance\Performance;

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

//
// Run test code
//

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

## Install with Composer
Get PHP performance by running the Composer command in the command line.
```{r, engine='bash', count_lines}
$ composer require bvanhoekelen/performance
```

Open your file for the performance test.
```php
// Require vender autoload
require_once('../vendor/autoload.php');

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

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

//
// Run test code
//

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