Download the PHP package classmarkets/statsd without Composer
On this page you can find all versions of the php package classmarkets/statsd. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download classmarkets/statsd
More information about classmarkets/statsd
Files in classmarkets/statsd
Package statsd
Short Description A simple library for interacting with a statsd server
License MIT
Informations about the package statsd
PHP StatsD Client
This is a PHP statsd client based on work by John Crepezzi. We refactored the library into a composer module and opened the API a bit to improve flexibility.
Installation
composer.json
Usage
Gauges
Counting
To count things:
Timing
Record timings:
Timings are given in milliseconds, see https://github.com/etsy/statsd#timing
Timing Closures
And a convenience mechanism for timing:
Configuration
Host and Port
If called like this, Statsd will create a default UDP socket. For more control you can also pass a socket as the third argument:
Sample Rate
Any of the methods descriped in the usage section can take an optional third argument $rate
, which is the sample rate:
Changes to the original library
- BC break CodeIgniter support has been removed. We are not familiar with CI and thus can't guarantee for compatibility. Support may be re-added in the future.
- BC break
Statsd
has been moved to the\Classmarkets
namespace. - BC break Codestyle has been changed to PSR-1.
Statsd::time_this()
is now calledStatsd::timeThis()
. - BC break
Statsd::counting()
has been renamed toStatsd::count()
for consistency Statsd::send()
is nowpublic
, allowing to send arbitrary messages to statsd, like sending a batch of newline separated messages in one go.- Support for gauges and sets has been added.
- All messages are sent over one socket per
Statsd
instance, instead of creating a new one for each message, giving a significant speed improvement when reusing the same instance. - The constructor now accepts an optional socket as its third argument.
- All methods return the result of
socket_sendto()
, so client code can deal with errors if desired.
Authors
- John Crepezzi [email protected]
- Peter Schultz [email protected]
License
(The MIT License)
Copyright © 2012 John Crepezzi
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. MIT License. See attached LICENSE