public function testCustomMetric() { $name = 'foo'; $value = 9000; $result = true; $handler = $this->getHandlerSpy('newrelic_custom_metric', array($name, $value), $result); $agent = new Newrelic(false, $handler); $this->assertSame($result, $agent->customMetric($name, $value)); }
/** * Adds a custom metric with the specified name and value, which is of type double. Values saved are assumed to be * milliseconds, so "4" will be stored as ".004" in our system. Your custom metrics can then be used in custom * dashboards and custom views in the New Relic user interface. It's a best practice to name your custom metrics * with a Custom/ prefix. This will make them easily usable in custom dashboards. * * Note: Avoid creating too many unique custom metric names. New Relic limits the total number of custom metrics you * can use (not the total you can report for each of these custom metrics). Exceeding more than 2000 unique custom * metric names can cause automatic clamps that will affect other data. * * @param string $name * @param mixed $value * @return mixed * @static */ public static function customMetric($name, $value) { return \Intouch\Newrelic\Newrelic::customMetric($name, $value); }