public function testSendIsRecordingInBatch()
 {
     $this->client->startBatch();
     $this->client->increment("foobar", 1);
     $message = $this->connection->getLastMessage();
     $this->assertNull($message);
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function increment($key, $sampleRate = 1)
 {
     $this->client->increment($key, $sampleRate);
 }
Example #3
0
 /**
  * Increments a value in statsd.
  *
  * @static
  *
  * @param string $name the name of the key
  * @param int $amount the amount it's incremented
  */
 public function increment($name, $amount = 1)
 {
     $this->statsd->increment($name, $amount = 1);
 }
Example #4
0
 /**
  * Increment metric key
  *
  * @param string $key Something like: 'foo.bar'
  */
 private function increment($key)
 {
     $this->client->increment($key);
 }
Example #5
0
 /**
  * @group sampling
  */
 public function testIncrementWithSamplingRate()
 {
     $client = new Client($this->connection, 'test', 0.3);
     $client->increment('foo.baz', 1);
     $this->assertEquals('test.foo.baz:1|c|@0.3', $this->connection->getLastMessage());
 }