Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/t3sec/php-library-gearman-status
Library for getting status and statistic data of a Gearman Jobserver
https://github.com/t3sec/php-library-gearman-status
composer gearman jobserver php
Last synced: 25 days ago
JSON representation
Library for getting status and statistic data of a Gearman Jobserver
- Host: GitHub
- URL: https://github.com/t3sec/php-library-gearman-status
- Owner: t3sec
- License: mit
- Created: 2016-12-16T19:58:16.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-04T22:19:13.000Z (almost 8 years ago)
- Last Synced: 2024-04-02T16:45:41.925Z (7 months ago)
- Topics: composer, gearman, jobserver, php
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-gearman-status
Library for getting status and statistic data of a Gearman Jobserver## Requirements
* php >=5.3.0
## Installation
```bash
$ composer require t3sec/gearman-status
```## Usage
### Namespacing
```php
use T3sec\GearmanStatus\GearmanMetrics;
use T3sec\GearmanStatus\GearmanServer;
```### Basic Example
```php
$server = new GearmanServer();
$gearmanMetrics = new GearmanMetrics($server);var_dump($gearmanMetrics->getRawData());
```Uses default configuration of a Gearman Jobserver and returns raw metrics as array.
### Advanced Example
```php
$server = new GearmanServer('192.1.1.10', 4444);
$gearmanMetrics = new GearmanMetrics($server);$numWorkers = $gearmanMetrics->getNumberOfWorkersByFunction('ReverseIpLookup');
$unfinishedTasks = $gearmanMetrics->getUnfinishedTasksByFunction('ReverseIpLookup');
```Retrieves metrics of a Gearman jobserver at IP 192.1.1.10 listening at port 4444.
Number of connected workers and unfinished tasks are returned.### Exception handling
* \InvalidArgumentException is thrown if a GermanServer is configured with invalid settings
* T3sec\GearmanStatus\Exception\GearmanStatusException is thrown if the connection to the Gearman jobserver cannot be established