-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add backwards compatibily for non dataDog statsd server
rename to DogStatsD
- Loading branch information
Harry Bragg
committed
Nov 4, 2015
1 parent
285c1ea
commit a14bde0
Showing
20 changed files
with
143 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,10 @@ | |
[](https://packagist.org/packages/graze/statsd-dd) | ||
[](LICENSE.md) | ||
[](https://travis-ci.org/graze/statsd-dd) | ||
[](https://scrutinizer-ci.com/g/graze/statsd-dd/code-structure) | ||
[](https://scrutinizer-ci.com/g/graze/statsd-dd) | ||
[](https://packagist.org/packages/graze/statsd-dd) | ||
|
||
Client to talk to [DataDogs StatsD Agent](http://docs.datadoghq.com/guides/dogstatsd) | ||
Client to talk to [DataDogs StatsD Agent](http://docs.datadoghq.com/guides/dogstatsd) Forked from: | ||
[League/StatsD](https://github.com/thephpleague/statsd) | ||
|
||
## Install | ||
|
||
|
@@ -22,7 +21,7 @@ $ composer require graze/statsd-dd | |
### Configuring | ||
|
||
```php | ||
$statsd = new Graze\DDStatsD\Client(); | ||
$statsd = new Graze\DogStatsD\Client(); | ||
$statsd->configure(array( | ||
'host' => '127.0.0.1', | ||
'port' => 8125, | ||
|
@@ -33,8 +32,8 @@ $statsd->configure(array( | |
OR | ||
|
||
```php | ||
$statsd1 = DDStatsD\Client::instance('server1')->configure(array(...)); | ||
$statsd2 = DDStatsD\Client::instance('server2')->configure(array(...)); | ||
$statsd1 = DogStatsD\Client::instance('server1')->configure(array(...)); | ||
$statsd2 = DogStatsD\Client::instance('server2')->configure(array(...)); | ||
``` | ||
|
||
The StatsD client waits for `ini_get('default_socket_timeout')` seconds when opening the socket by default. To reduce | ||
|
@@ -49,7 +48,16 @@ to disable these exceptions and log a PHP warning instead if you wish. To do so, | |
|
||
If omitted, this option defaults to `true`. | ||
|
||
### Counters | ||
#### Core StatsD implementation | ||
|
||
To use this with a core statsd implementation include the following in your configuration: | ||
``` | ||
'dataDog' => false | ||
``` | ||
|
||
### Methods | ||
|
||
#### Counters | ||
|
||
```php | ||
$statsd->increment('web.pageview'); | ||
|
@@ -61,43 +69,43 @@ $statsd->increment(array( | |
$statsd->increment('web.clicks', 1, 0.5); | ||
``` | ||
|
||
### Gauges | ||
#### Gauges | ||
|
||
```php | ||
$statsd->gauge('api.logged_in_users', 123456); | ||
``` | ||
|
||
|
||
### Sets | ||
#### Sets | ||
|
||
```php | ||
$userID = 23; | ||
$statsd->set('api.unique_logins', $userID); | ||
``` | ||
|
||
### Timers | ||
#### Timers | ||
|
||
```php | ||
$statsd->timing('api.response_time', 256); | ||
``` | ||
|
||
## Timing Blocks | ||
#### Timing Blocks | ||
|
||
```php | ||
$statsd->time('api.dbcall', function () { | ||
// this code execution will be timed and recorded in ms | ||
}); | ||
``` | ||
|
||
## Tags | ||
#### Tags | ||
|
||
```php | ||
$statsd->increment('web.pageview', 1, ['page' => 'some/page']); | ||
$statsd->guage('api.logged_in_users', 123456, ['environement' => 'live']); | ||
$statsd->set('api.unique_logins', $userID, [' | ||
$statsd->set('api.unique_logins', $userID, ['tag']); | ||
$statsd->timing('api.response_time', 245, ['end-point' => 'page', 'env' => 'test']); | ||
``` | ||
|
||
## Events | ||
#### Events | ||
|
||
```php | ||
$statsd->event( | ||
|
@@ -113,7 +121,7 @@ $statsd->event( | |
); | ||
``` | ||
|
||
## Service Check | ||
#### Service Check | ||
|
||
```php | ||
$statsd->serviceCheck( | ||
|
@@ -151,7 +159,7 @@ If you discover any security related issues, please email [email protected] | |
### Forked from [thephpleague/statsd](https://github.com/thephpleague/statsd): | ||
|
||
- [Marc Qualie](https://github.com/marcqualie) | ||
- [League\statsd Contributors](https://github.com/thephpleague/statsd/contributors) | ||
- [League/StatsD Contributors](https://github.com/thephpleague/statsd/contributors) | ||
|
||
## License | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.