コード例 #1
0
 /**
  * @param Metric $metric
  */
 private function publishMetric(Metric $metric)
 {
     if ($metric->getType() == Metric::TYPE_INCREMENT) {
         $this->beberleiCollector->increment($metric->getName());
     } elseif ($metric->getType() == Metric::TYPE_DECREMENT) {
         $this->beberleiCollector->decrement($metric->getName());
     } elseif ($metric->getType() == Metric::TYPE_TIMING) {
         $this->beberleiCollector->timing($metric->getName(), $metric->getValue());
     } else {
         $this->beberleiCollector->measure($metric->getName(), $metric->getValue());
     }
 }
コード例 #2
0
 function it_auto_flushes_by_default(Collector $beberleiCollector)
 {
     $this->publish([]);
     $beberleiCollector->flush()->shouldBeCalled();
 }