PHP code example of t3sec / gearman-status

1. Go to this page and download the library: Download t3sec/gearman-status 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/ */

    

t3sec / gearman-status example snippets


use T3sec\GearmanStatus\GearmanMetrics;
use T3sec\GearmanStatus\GearmanServer;

$server = new GearmanServer();
$gearmanMetrics = new GearmanMetrics($server);

var_dump($gearmanMetrics->getRawData());

$server = new GearmanServer('192.1.1.10', 4444);
$gearmanMetrics = new GearmanMetrics($server);

$numWorkers = $gearmanMetrics->getNumberOfWorkersByFunction('ReverseIpLookup');
$unfinishedTasks = $gearmanMetrics->getUnfinishedTasksByFunction('ReverseIpLookup');