• EnglishEspañol日本語한국어Português
  • 로그인지금 시작하기

사용자의 편의를 위해 제공되는 기계 번역입니다.

In the event of any inconsistency between the English version and the translated version, the English versionwill take priority. Please visit this page for more information.

문제 신고

상호 작용 중지

통사론

자바

NewRelic.endInteraction(string $interactionID)

코틀린 [#kotlin]

NewRelic. endInteraction(id : String!)

설명 [#description]

New Relic은 모든 상호작용을 자동으로 종료하지만 endInteraction() 를 사용하여 사용자 지정 상호작용을 조기에 종료할 수 있습니다. startInteraction() 호출을 사용할 때 문자열 ID가 반환됩니다.

상호 작용이 이미 종료된 경우 이 호출은 효과가 없습니다.

매개변수 [#parameters]

매개변수

유형

설명

interactionID

string

필수의. startInteraction 에서 반환된 값입니다. 상호 작용 추적을 수동으로 완료하려면 이 문자열을 전달해야 합니다.

예시 [#example]

다음은 맞춤 상호작용 RefreshContacts 을 종료하는 예입니다.

자바 [#java]

public class MainActivity extends Activity {
...
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_refresh:
String interactionId = NewRelic.startInteraction("RefreshContacts");
...
return true;
default:
NewRelic.endInteraction(interactionId);
return super.onOptionsItemSelected(item);
}
}
...
}

통사론

목표-c

+ (void) stopCurrentInteraction:(NSString*)interactionIdentifier;

빠른 [#swift]

NewRelic.stopInteraction(string: "myInteractionName")

설명 [#description]

이 메서드는 interactionIdentifier ( startInteractionWithName: 메서드에서 반환됨)와 연결된 상호작용 추적을 중지합니다. 상호 작용 추적을 완료하기 위해 이 메서드를 호출할 필요는 없습니다(상호 작용 추적은 자체적으로 지능적으로 완료됨). 그러나 보다 개별적인 상호 작용 기간을 원하는 경우 이 방법을 사용하십시오.

매개변수 [#parameters]

매개변수

유형

설명

interactionIdentifier

string

필수의. startInteractionWithName: 에서 반환된 값입니다. 상호 작용 추적을 수동으로 완료하려면 이 문자열을 전달해야 합니다.

[#examples]

오브젝티브-C [#obj-c]

NSString *identifier = [NewRelic startInteractionWithName: @"myInteractionName"];
[NewRelic stopCurrentInteraction: identifier];

빠른 [#swift]

let identifier = NewRelic.startInteraction(withName: "myInteractionName")
NewRelic.stopCurrentInteraction(identifier)

통사론

endInteraction(options: { interactionId: string; }) => void

설명 [#description]

종료하려는 상호작용의 문자열 ID를 사용합니다. 이 문자열은 startInteraction() 사용할 때 반환됩니다.

매개변수 [#parameters]

매개변수

유형

설명

interactionID

string

필수의. startInteraction 에서 반환된 값입니다. 상호 작용 추적을 수동으로 완료하려면 이 문자열을 전달해야 합니다.

예시 [#example]

const badApiLoad = async () => {
const id = await NewRelicCapacitorPlugin.startInteraction({ value: 'StartLoadBadApiCall' });
console.log(id);
const url = 'https://fakewebsite.com/moviessssssssss.json';
fetch(url)
.then((response) => response.json())
.then((responseJson) => {
console.log(responseJson);
NewRelicCapacitorPlugin.endInteraction({ interactionId: id.value });
}) .catch((error) => {
NewRelicCapacitorPlugin.endInteraction({ interactionId: id.value });
console.error(error);
});
};

통사론

endInteraction(id: InteractionId): void;

설명 [#description]

종료하려는 상호작용의 문자열 ID를 사용합니다. 이 문자열은 startInteraction() 사용할 때 반환됩니다.

매개변수 [#parameters]

매개변수

유형

설명

id

InteractionId

필수의. startInteraction 에서 반환된 값입니다. 상호 작용 추적을 수동으로 완료하려면 이 문자열을 전달해야 합니다.

예시 [#example]

const badApiLoad = async () => {
const interactionId = await NewRelic.startInteraction('StartLoadBadApiCall');
console.log(interactionId);
const url = 'https://cordova.apache.org/moviessssssssss.json';
fetch(url)
.then((response) => response.json())
.then((responseJson) => {
console.log(responseJson);
NewRelic.endInteraction(interactionId);
}) .catch((error) => {
NewRelic.endInteraction(interactionId);
console.error(error);
});

통사론

EndInteraction(string interactionId): void;

설명 [#description]

종료하려는 상호작용의 문자열 ID를 사용합니다. 이 문자열은 startInteraction() 사용할 때 반환됩니다.

매개변수 [#parameters]

매개변수

유형

설명

interactionId

string

필수의. startInteraction 에서 반환된 값입니다. 상호 작용 추적을 수동으로 완료하려면 이 문자열을 전달해야 합니다.

예시 [#example]

HttpClient myClient = new HttpClient(CrossNewRelic.Current.GetHttpMessageHandler());
string interactionId = CrossNewRelic.Current.StartInteraction("Getting data from service");
var response = await myClient.GetAsync(new Uri("https://jsonplaceholder.typicode.com/todos/1"));
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
} else
{
Console.WriteLine("Unsuccessful response code");
}
CrossNewRelic.Current.EndInteraction(interactionId);

통사론

endInteraction(String interactionId): void;

설명 [#description]

종료하려는 상호작용의 문자열 ID를 사용합니다. 이 문자열은 startInteraction() 사용할 때 반환됩니다.

매개변수 [#parameters]

매개변수

유형

설명

interactionId

string

필수의. startInteraction 에서 반환된 값입니다. 상호 작용 추적을 수동으로 완료하려면 이 문자열을 전달해야 합니다.

예시 [#example]

var id = await NewrelicMobile.instance.startInteraction("Getting Data from Service");
try {
var dio = Dio();
var response = await dio.get(
'https://reqres.in/api/users?delay=15');
print(response);
NewrelicMobile.instance.endInteraction(id);
Timeline.finishSync();
} catch (e) {
print(e);
}

통사론

endInteraction(id: InteractionId): void;

설명 [#description]

종료하려는 상호작용의 문자열 ID를 사용합니다. 이 문자열은 startInteraction() 사용할 때 반환됩니다.

매개변수 [#parameters]

매개변수

유형

설명

InteractionID

string

필수의. startInteraction 에서 반환된 값입니다. 상호 작용 추적을 수동으로 완료하려면 이 문자열을 전달해야 합니다.

예시 [#example]

const badApiLoad = async () => {
const interactionId = await NewRelic.startInteraction('StartLoadBadApiCall');
console.log(interactionId);
const url = 'https://facebook.github.io/react-native/moviessssssssss.json';
fetch(url)
.then((response) => response.json())
.then((responseJson) => {
console.log(responseJson);
NewRelic.endInteraction(interactionId);
}) .catch((error) => {
NewRelic.endInteraction(interactionId);
console.error(error);
});;
};

통사론

StopCurrentInteraction(string interactionId): void;

설명 [#description]

종료하려는 상호작용의 문자열 ID를 사용합니다. 이 문자열은 startInteraction() 사용할 때 반환됩니다.

매개변수 [#parameters]

매개변수

유형

설명

interactionId

string

필수의. startInteraction 에서 반환된 값입니다. 상호 작용 추적을 수동으로 완료하려면 이 문자열을 전달해야 합니다.

예시 [#example]

string interActionId = NewRelicAgent.StartInteractionWithName("Unity InterAction Example");
for(int i =0; i < 4;i++)
{
Thread.Sleep(1000);
}
NewRelicAgent.StopCurrentInteraction(interActionId);

통사론

endInterAction(FString interActionId): void;

설명 [#description]

종료하려는 상호작용의 문자열 ID를 사용합니다. 이 문자열은 startInteraction() 사용할 때 반환됩니다.

매개변수 [#parameters]

매개변수

유형

설명

interactionId

FString

필수의. startInteraction 에서 반환된 값입니다. 상호 작용 추적을 수동으로 완료하려면 이 문자열을 전달해야 합니다.

예시 [#example]

#include "NewRelicBPLibrary.h"
FString id = UNewRelicBPLibrary::startInterAction("test Unreal InterAction");
FPlatformProcess::Sleep(6.0);
UNewRelicBPLibrary::endInterAction(id);

통사론

EndInteraction(string interactionId): void;

설명 [#description]

종료하려는 상호작용의 문자열 ID를 사용합니다. 이 문자열은 startInteraction() 사용할 때 반환됩니다.

매개변수 [#parameters]

매개변수

유형

설명

interactionId

string

필수의. startInteraction 에서 반환된 값입니다. 상호 작용 추적을 수동으로 완료하려면 이 문자열을 전달해야 합니다.

예시 [#example]

HttpClient myClient = new HttpClient(CrossNewRelicClient.Current.GetHttpMessageHandler());
string interactionId = CrossNewRelicClient.Current.StartInteraction("Getting data from service");
var response = await myClient.GetAsync(new Uri("https://jsonplaceholder.typicode.com/todos/1"));
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
} else
{
Console.WriteLine("Unsuccessful response code");
}
CrossNewRelicClient.Current.EndInteraction(interactionId);
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.