コード例 #1
0
 public function testSendIsRecordingInBatch()
 {
     $this->client->startBatch();
     $this->client->increment("foobar", 1);
     $message = $this->connection->getLastMessage();
     $this->assertNull($message);
 }
コード例 #2
0
ファイル: Metric.php プロジェクト: rfeiner/yii2-statsd
 /**
  * @inheritdoc
  */
 public function increment($key, $sampleRate = 1)
 {
     $this->client->increment($key, $sampleRate);
 }
コード例 #3
0
ファイル: StatsD.php プロジェクト: milleruk/projectRena
 /**
  * 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);
 }
コード例 #4
0
ファイル: StatsD.php プロジェクト: jhmilan/stats-collector
 /**
  * Increment metric key
  *
  * @param string $key Something like: 'foo.bar'
  */
 private function increment($key)
 {
     $this->client->increment($key);
 }
コード例 #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());
 }