示例#1
0
 /**
  * @dataProvider dataAverage
  */
 public function testAverage($expectedAvg, $mockData)
 {
     $graphite = $this->mockFactory->getGraphiteClientMock();
     $target = new Target($graphite, 'test.target', array(), array());
     $graphite->expects($this->once())->method('getData')->will($this->returnValue($mockData));
     $avg = $target->avg();
     $this->assertEquals($expectedAvg, $avg);
 }
示例#2
0
 /**
  * @deprecated
  */
 public function getAvgTargetValue($target, $graphiteUrl, array $options, $nullAsZero = false)
 {
     $options['nullAsZero'] = (int) $nullAsZero;
     $target = new Target($this, $target, array(), $options);
     return $target->avg();
 }