integer-net/deployer-timer

Collect duration of deployer tasks

0.1.1 2022-04-28 07:30 UTC

This package is auto-updated.

Last update: 2024-03-28 11:44:23 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

This is a recipe for Deployer that lets you track the duration of all tasks

It can create a CSV file in the form of

BEGIN,deploy,1553682974.4,0
BEGIN,build,1553682974.4,0
END,build,1553682975,0.6
BEGIN,copy,1553682975,0
END,copy,1553682978.5,3.5
BEGIN,release,1553682978.5,0
END,release,1553682979.3,0.8
END,deploy,1553682979.3,4.9

The columns are:

  • BEGIN or END, marking time where a task started or finished
  • task name
  • Unix timestamp (as float)
  • Duration of task in seconds (only in END rows)

Installation

  1. Require via composer
    composer require integer-net/deployer-timer
    

Usage

In your deploy.php file:

  1. Include the recipe:

    require __DIR__ . '/vendor/integer-net/deployer-timer/recipe/timer.php';
    
  2. Configure the timer at the end:

    after('deploy', timer()->createCsvResultTask('path/to/file.csv'));
    
    

    timer() must be called after all other tasks are defined. The generated task to create a CSV result file should be added at the end of the task/group that should be timed (e.g. deploy)

Troubleshooting

If you receive errors about missing classes, include the standalone autoloader:

require __DIR__ . '/vendor/integer-net/deployer-timer/autoload.php';

This way, you can use the recipe without relying on the composer autoloader (e.g. when running deployer as phar)

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

composer test

Runs unit tests, mutation tests and static analysis

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email fs@integer-net.de instead of using the issue tracker.

Credits

License

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