Example #1
0
 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());
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function time($key, \Closure $_block, $sampleRate = 1)
 {
     return $this->client->time($key, $_block, $sampleRate);
 }
Example #3
0
 /**
  * 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);
 }