Download the PHP package simple-as-fuck/php-performance-log without Composer

On this page you can find all versions of the php package simple-as-fuck/php-performance-log. 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 php-performance-log

Simple as fuck / Php performance log

Services for logging slow parts of application.

Installation

Support

If any PHP platform requirements in composer.json ends with security support, consider package version as unsupported except last version.

PHP supported versions.

Measurements support

Application Http requests DB transactions SQL queries Console commands Queue Jobs
Laravel With middleware use default 1 second Default 300 milliseconds Default 50 milliseconds Default off Recommended 40 seconds

Laravel application

Global thresholds configuration are in performance_log.php config, publishable from package.

For http request time logging you must register LaravelMiddleware as global on first position.

Other applications

All package services or listeners do not have any external dependencies except PSR interfaces, is possible use package for measurement of different types of applications.

You must register some PerformanceLogConfig extends to your application as unique global instance (singleton), because in the service state are hold temporary thresholds overwrites, and you should overwrite methods getConfig..., where you can configure your global thresholds or in methods load thresholds from application configuration files.

Thresholds values has behaviour: not zero value will log longer runs then threshold value as warning, null or zero value turn off measurement, zero value with debug true will log running time as debug.

You can look at LaravelPerformanceLogConfig as example.

You must register listeners to your application as singletons, because most listeners has state and hold measurements data inside. PSR-14 listeners are callables, you can register package listeners by anonymous function adapters.

You can look at LaravelProvider as example.

For http request time logging you must register PsrMiddleware. Recommended usage is register middleware as global on first position and all of your request will be measured.

Thresholds overwrite

Sql

If you know than some sql is slow, and you are fine with that you can overwrite global thresholds configuration by setting a temporary threshold in PerformanceLogConfig.

Http

If you know that some specific controller action is slow or should be extra fast, you can overwrite global threshold configuration by setting a temporary threshold. The temporary threshold can be set anywhere in request run and live until a request ends.

Console

If you want to overwrite global threshold configuration, you can do it by setting a temporary threshold. The temporary threshold can be set anywhere in command run and live until a command ends.

Job

If you want to overwrite global threshold configuration, you can set a temporary threshold. The temporary threshold can be set anywhere in job run and live until a job ends.

Usage with monitoring

Is recommended send performance warning logs into your monitoring system, so you know what is slow.

For simple monitoring is sentry integration. Sentry integration can collect information about request or command with stacktrace, this can make finding slow query much easier.


All versions of php-performance-log with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^8.30|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/console Version ^8.30|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^8.30|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^8.30|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/log Version ^8.30|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^8.30|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/events Version ^8.30|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/queue Version ^8.30|^9.0|^10.0|^11.0|^12.0|^13.0
simple-as-fuck/php-validator Version ^0.1.0|^0.2.0|^0.3.0|^0.4.0|^0.5.0|^0.6.0|^0.7.0|^0.8.0
symfony/http-foundation Version ^5.4|^6.0|^7.0|^8.0
psr/log Version ^1.0|^2.0|^3.0
psr/http-server-handler Version ^1.0
psr/http-message Version ^1.0|^2.0
psr/http-server-middleware Version ^1.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 simple-as-fuck/php-performance-log contains the following files

Loading the files please wait ...