func BeginExternalSegment(txnID int64, parentID int64, host string, name string) int64 {
	chost := C.CString(host)
	defer C.free(unsafe.Pointer(chost))
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))
	id := C.newrelic_segment_external_begin(C.long(txnID), C.long(parentID), chost, cname)
	return int64(id)
}
Example #2
0
/*
 * Identify the beginning of a segment that performs an external service.
 *
 * @param transaction_id  id of transaction
 * @param parent_segment_id  id of parent segment
 * @param host  name of the host of the external call
 * @param name  name of the external transaction
 * @return  segment id on success, else negative warning code or error code
 */
func SegmentExternalBegin(id, parent int64, host, name string) (int64, error) {
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))

	chost := C.CString(host)
	defer C.free(unsafe.Pointer(chost))

	return errNoLong(C.newrelic_segment_external_begin(C.long(id), C.long(parent), chost, cname))
}