PHP code example of chris-ware / pulse-health-check

1. Go to this page and download the library: Download chris-ware/pulse-health-check 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/ */

    

chris-ware / pulse-health-check example snippets


use ChrisWare\PulseHealthCheck\Checks\PulseCacheHitRatioCheck;

PulseCacheHitRatioCheck::new();

use ChrisWare\PulseHealthCheck\Checks\PulseCacheHitRatioCheck;

PulseCacheHitRatioCheck::new()->failWhenSizeRatioBelow(25)->warnWhenSizeRatioBelow(50);

use ChrisWare\PulseHealthCheck\Checks\PulseCheck;

PulseCheck::new()
    ->for('slow_query')
    ->failWhenAbove(5)
    ->warnWhenAbove(3)
    ->interval(\Carbon\CarbonInterval::minutes(5));

use ChrisWare\PulseHealthCheck\Checks\PulseCheck;

PulseCheck::new()
    ->for('user_request')
    ->aggregate('count')
    ->failWhenAbove(500)
    ->warnWhenAbove(300)
    ->interval(\Carbon\CarbonInterval::minutes(5));