Ejemplo n.º 1
0
func RecordMetric(name string, val float64) error {
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))
	rv := C.newrelic_record_metric(cname, C.double(val))
	return nrError(rv, "record metric")
}
Ejemplo n.º 2
0
/*
 * Record a custom metric.
 *
 * @param   name  the name of the metric
 * @param   value   the value of the metric
 * @return  0 on success, else negative warning code or error code
 */
func RecordMetric(name string, value float64) (int, error) {
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))
	return errNo(C.newrelic_record_metric(cname, C.double(value)))
}