dog-statsd icon indicating copy to clipboard operation
dog-statsd copied to clipboard

Get the stream

Open marcguyer opened this issue 7 years ago • 0 comments

Close #27.

Add a public method to get the StreamWriter object from the Client. This enables closing the socket:

$statsd = new \Graze\DogStatsD\Client();
$statsd->configure(
    [
        'host' => '127.0.0.1',
        'port' => 8125,
        'namespace' => 'some.namespace',
    ]
);

$statsd->gauge('someMetric', 1);

$stream = $statsd->getStream();
$stream->__destruct();

unset($statsd);

marcguyer avatar Jun 25 '18 14:06 marcguyer