public function testFactoryCanCreateMetric() { $metric = Factory::buildMetric('test.metric.name', array(array(20), array(time() - 20, 20)), array('type' => Metric::TYPE_COUNTER, 'host' => 'foo.bar.com', 'tags' => array('foo' => 'bar'))); $this->assertEquals(Metric::TYPE_COUNTER, $metric->getType()); $this->assertEquals('foo.bar.com', $metric->getHost()); $this->assertEquals(array('foo' => 'bar'), $metric->getTags()); $this->assertInstanceOf('Bayer\\DataDogClient\\Series\\Metric', $metric); }
/** * Send metric data to datadog * * The given values will be used to create a new Metric * object, encapsulated it into a Series and sent. * * @param string $name * @param array $points * @param array $options * * @return Client */ public function metric($name, array $points, array $options = array()) { return $this->sendMetric(Factory::buildMetric($name, $points, $options)); }