PHP code example of frzb / metrics-power

1. Go to this page and download the library: Download frzb/metrics-power 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/ */

    

frzb / metrics-power example snippets




use FRZB\Component\MetricsPower\Attribute\Metrical;
use FRZB\Component\MetricsPower\Attribute\PrometheusOptions;

#[Metrical(
    new PrometheusOptions(
        'some_topic',
        'CreateUserMessage',
        'Total of user messages',
        ['label'],
        ['total']
    ),
)]
final class CreateUserMessage {
    public function __construct(
        public readonly string $id,
        public readonly string $name,
    ) {}
}