PHP code example of wyrihaximus / metrics-tactician

1. Go to this page and download the library: Download wyrihaximus/metrics-tactician library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wyrihaximus / metrics-tactician example snippets




declare(strict_types=1);

use WyriHaximus\Metrics\Factory;
use WyriHaximus\Metrics\Label;
use WyriHaximus\Metrics\Tactician\CollectorMiddleware;
use WyriHaximus\Metrics\Tactician\Metrics;

$registry  = Factory::create();
$metrics   = Metrics::create($registry, new Label('bus', 'name of your command bus'));
$collector = new CollectorMiddleware($metrics); // Toss this in the collection of middleware you pass to Tactician