Download the PHP package tuupola/server-timing-middleware without Composer

On this page you can find all versions of the php package tuupola/server-timing-middleware. 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 server-timing-middleware

PSR-7 and PSR-15 Server Timing Middleware

Latest Version Build Status Coverage

This middleware implements the Server-Timing header which can be used for displaying server side timing information on Chrome DevTools.

Server Timing

Install

Install using Composer:

Simple usage

To get the default timings add the middleware to the pipeline. With Zend Expressive this goes go to the file named config/pipeline.php.

Slim Framework does not have specific config files. Otherwise adding the middleware is similar with previous.

You should now see the default timings when doing a request.

  1. Bootstrap is the time taken from start of the request to execution of the first incoming middleware
  2. Process is the time taken for server to generate the response and process the middleware stack
  3. Total is the total time taken

Note that ServerTimingMiddleware must be added as last middleware. Otherwise timings will be inaccurate.

Changing the defaults

If you are not happy with the above you can change the description by using an optional settings array. To disable any of the defaults set the description to null.

Advanced usage

Example below uses Slim Framework. Note again that ServerTimingMiddleware must be added as last middleware. Otherwise timings will be inaccurate.

You can add your own timings by using the Stopwatch instance. See example below.

Usage with Doctrine DBAL

If you use Doctrine DBAL you can automate SQL query timings by using the provided QueryTimer. It implements the DBAL SQLLogger interface and can be used as standalone or in a LoggerChain. You must use the same Stopwatch instance with both QueryTimer and ServerTimingMiddleware middleware.

Testing

You can run tests either manually or automatically on every code change. Automatic tests require entr to work.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

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


All versions of server-timing-middleware with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1|^8.0
psr/http-server-middleware Version ^1.0
symfony/stopwatch Version ^4.0|^5.0|^6.0
tuupola/callable-handler 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 tuupola/server-timing-middleware contains the following files

Loading the files please wait ....