public function testSendIsRecordingInBatch() { $this->client->startBatch(); $this->client->increment("foobar", 1); $message = $this->connection->getLastMessage(); $this->assertNull($message); }
/** * @inheritdoc */ public function increment($key, $sampleRate = 1) { $this->client->increment($key, $sampleRate); }
/** * 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); }
/** * Increment metric key * * @param string $key Something like: 'foo.bar' */ private function increment($key) { $this->client->increment($key); }
/** * @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()); }