public function testTimeClosure() { $evald = $this->client->time('foo', function () { return "foobar"; }); $this->assertEquals('foobar', $evald); $this->assertRegExp('/test\\.foo\\.baz:100[0|1]{1}|ms|@0.1/', $this->connection->getLastMessage()); }
/** * @inheritdoc */ public function time($key, \Closure $_block, $sampleRate = 1) { return $this->client->time($key, $_block, $sampleRate); }
/** * Time metric * * @param string $key Something like: 'foo.bar' * @param Closure $closure Something like: function ( ) { ... } */ private function time($key, $closure) { $this->client->time($key, $closure); }