Download the PHP package duckstery/process-analyzer without Composer

On this page you can find all versions of the php package duckstery/process-analyzer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package process-analyzer

Dependency free process analyzer for PHP

Table of Contents
  1. Feature
  2. Installation
    • PHP 8+
    • Laravel
  3. Configuration
    • How to config
    • Options
    • Printer's hooks
  4. Usage
    • Basic
    • Use default Profile name and extra metrics
    • Use default Record name
    • Use multiple Profile
  5. Testing
  6. Issue
  7. License

Feature

For example, you can do this:

After that, you will get a report like this

The report can be printed to file or console. Moreover, you can decide to grab the report result and print it to wherever you want

Installation

For PHP 8+

Run script to install

For Laravel

[!WARNING]
This integration only work properly while handling request individually (1 request at a time) because it'll flush everything out at the end of the request.

Run script to install

Package's ServiceProvider will be auto required by Laravel. If you don't use auto-discovery, you need to manually add ServiceProvider

to the providers array in

Then, you can publish config file for better customization

Configuration

How to config

Before use, you should config package to match your needs.

To config, create a class and extend like this

Then, you can override 's properties or functions and change their value

Beware that config with function override will ignore the property's value. If you config logic is big, you should use function override instead.

After creating config class, init with your class's instance

Options

: This option will enable and disable . With this option, you can include this package in production. If you need it to measure your process in production, you can switch it on. But remember to switch it off after

: Define default Profile name

: Define getter method name. This method will return Record's default name

: Define extra metrics for Profile. These metrics can be retrieved at the start or end of execution. After that, can calculate difference or format them

: Profile class. You can customize by create a new class that extend

: Record class

: Printer class

: Print report in table

: Print each Record in report in a line. Ignored if : true

: Show Record's UID in report

: Define path to directory that holds report file. Report file will be created each day. If is false, report won't be printed to any file

: Print result to console. If is false, report won't be printed to console

: Define Profile's name prefix

: Define Profile's name suffix

: Define Record's name prefix

: Define Record's suffix

: Define unit of time

: Define a callback to modify main time metrics. Ignored if this option is defined

: Define unit of memory

: Define a callback to modify main memory metrics. Ignored if this option is defined

: Define top left corner character

: Define top right corner character

: Define bottom left corner character

: Define bottom right corner character

: Define top fork character

: Define right fork character

: Define bottom fork character

: Define left fork character

: Define cross character

Printer's hooks

There are some printer's hooks that allow you to interact with report data. To use these hooks, create a class and extend

Then, override methods like this

These are some hooks that you can use:

: Execute before process Profile

: Execute on each Record and before process Record

: Execute on each Record and after process Record

: Execute on each Record and after convert Record to string

: Execute after complete the report

Usage

These are some examples to instruct you to use this package. You will be provided with a static class.

will only measure execution time and memory of your execution. It'll exclude self execution time and memory out of final result.

The basic approach is placing your logic inside and . When everything is done, call so Analyzer can generate the report for you.

The Laravel integration has a specific middleware that will execute at the end of request. So you don't need to while using that integration. But in most case, you have to flush at the end of your program (or at least at the end of the process that you desired to measure).

For any unmentioned situation, you can issue me for more detail.

Basic

Analyzer only measure execution time and memory of your execution

Report

SomeController --------------------
╭───────────────┬──────────┬─────────────┬────────╮
│ Uid           │ Name     │ Time        │ Memory │
├───────────────┼──────────┼─────────────┼────────┤
│ 654af62889e08 │ handle   │ 5036.472 ms │   5 KB │
│ 654af62889e09 │ processA │    6.472 ms │   0 KB │
│ 654af62889e10 │ processB │    6.472 ms │   5 KB │
│ 654af62889e11 │ processC │ 5000.472 ms │   0 KB │
╰───────────────┴──────────┴─────────────┴────────╯
------------------------------

Use default Profile name and extra metrics

Config

Capture metrics by using default Profile

Report

Default --------------------
╭───────────────┬────────────────────────┬─────────────┬────────┬────────────┬────────────┬───────────╮
│ Uid           │ Name                   │ Time        │ Memory │ Start peak │ Stop peak  │ Diff peak │
├───────────────┼────────────────────────┼─────────────┼────────┼────────────┼────────────┼───────────┤
│ 654af62889e08 │ SomeController::handle │ 2006.472 ms │   0 KB │ 16502872 B │ 16502872 B │       0 B │
╰───────────────┴────────────────────────┴─────────────┴────────┴────────────┴────────────┴───────────╯
----------------------------

Use default Record name

Capture metrics by using default Record name

Report

Default --------------------
╭───────────────┬──────────────────┬─────────────┬────────┬────────────┬────────────┬───────────╮
│ Uid           │ Name             │ Time        │ Memory │ Start peak │ Stop peak  │ Diff peak │
├───────────────┼──────────────────┼─────────────┼────────┼────────────┼────────────┼───────────┤
│ 654af62889e08 │ Function: handle │ 2006.472 ms │   0 KB │ 16502872 B │ 16502872 B │       0 B │
╰───────────────┴──────────────────┴─────────────┴────────┴────────────┴────────────┴───────────╯
----------------------------

Use multiple Profile

Capture metrics with multiple Profile

Report

Profile 1 --------------------
╭───────────────┬──────────────────┬─────────────┬────────╮
│ Uid           │ Name             │ Time        │ Memory │
├───────────────┼──────────────────┼─────────────┼────────┤
│ 654af62889e08 │ Function: handle │ 2006.472 ms │   0 KB │
╰───────────────┴──────────────────┴─────────────┴────────╯
------------------------------
Profile 2 --------------------
╭───────────────┬────────────────┬─────────────┬────────╮
│ Uid           │ Name           │ Time        │ Memory │
├───────────────┼────────────────┼─────────────┼────────┤
│ 654af62889e09 │ Function: todo │ 2006.472 ms │   0 KB │
╰───────────────┴────────────────┴─────────────┴────────╯
------------------------------

Testing

For testing

composer run-script test

For coverage

composer run-script test-coverage

Issue

If you discover any security-related issues, bugs or ideas, please feel free to create an issue.

License

The MIT License (MIT). Please see License File for more information.


All versions of process-analyzer with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package duckstery/process-analyzer contains the following files

Loading the files please wait ....