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

이 한글 문서는 사용자의 편의를 위해 기계 번역되었습니다.

영문본과 번역본이 일치하지 않는 경우 영문본이 우선합니다. 보다 자세한 내용은 이 페이지를 방문하시기 바랍니다.

문제 신고

상호 작용 시작

통사론

자바

NewRelic.startInteraction(string $interactionName)

코틀린 [#kotlin]

NewRelic.startInteraction(actionName: String)

설명 [#description]

Android 앱 코드에서 메서드를 계측하기 위한 상호 작용을 만듭니다.

이미 존재하고 추적 중인 상호작용의 이름을 지정하려면 setInteractionName() 참조하세요.

매개변수 [#parameters]

매개변수

유형

설명

$interactionName

string

필수의. 상호 작용에 부여할 이름입니다.

반환 값 [#return-values]

특정 지점에서 상호작용을 종료하는 데 사용할 수 있는 상호작용 ID 번호를 반환합니다.

예시 [#example]

다음은 RefreshContacts 라는 상호작용 추적을 시작하는 예입니다.

자바 [#java]

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

코틀린 [#kotlin]

class MainActivity : AppCompatActivity() {
.....
var client: OkHttpClient = OkHttpClient();
binding.fab.setOnClickListener { view ->
val interActionId = NewRelic.startInteraction("Getting Data From Server")
lifecycleScope.launch(Dispatchers.IO) {
val result = getRequest()
NewRelic.endInteraction(interActionId)
}
}
}
....
}

통사론

목표-c

+ (NSString*) startInteractionWithName:(NSString*)interactionName;

빠른 [#swift]

NewRelic.startInteraction(string: "myInteractionName")

설명 [#description]

이 메소드는 interactionName 을 이름으로 사용하여 상호작용 추적을 시작합니다. 상호 작용은 시간 초과가 발생하거나 stopCurrentInteraction 이 호출될 때까지 계측된 모든 메서드를 기록합니다.

이미 존재하고 추적 중인 상호작용의 이름을 지정하려면 setInteractionName() 참조하세요.

이러한 방법을 사용하는 경우, 계측된 복합체 복합은 복합복합 페이지에 표시되지 않지만 다음과 같은 NRQL 쿼리를 통해 찾을 수 있습니다.

query SELECT name FROM Mobile SINCE 7 DAYS AGO

매개변수 [#parameters]

매개변수

유형

설명

interactionName

string

필수의. 상호 작용에 부여할 이름입니다.

반환 값 [#return-values]

startInteractionWithName 가 호출되면 반환 값은 stopCurrentInteraction 에 전달되어야 하는 interactionIdentifier 입니다. 그러나 startInteractionWithName 는 결국 지능적으로 완료되기 때문에 start를 호출한 후 stopCurrentInteraction 을 호출할 필요는 없습니다.

[#examples]

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

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

빠른 [#swift]

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

통사론

startInteraction(options: { value: string; }) => Promise<{ value: string; }>

설명 [#description]

메서드를 상호 작용으로 추적합니다.

매개변수 [#parameters]

매개변수

유형

설명

options

{ value: string; }

필수의. 상호 작용에 부여할 이름입니다.

예시 [#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);
});
};

통사론

startInteraction(interactionName: string, cb?: function): Promise<InteractionId>;

설명 [#description]

메서드를 상호 작용으로 추적합니다.

매개변수 [#parameters]

매개변수

유형

설명

Interactioname

string

필수의. 상호 작용에 부여할 이름입니다.

예시 [#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);
});

통사론

StartInteraction(string interactionName): string;

설명 [#description]

메서드를 상호 작용으로 추적합니다.

매개변수 [#parameters]

매개변수

유형

설명

options

{ value: string; }

필수의. 상호 작용에 부여할 이름입니다.

예시 [#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);

통사론

startInteraction(String actionName);

설명 [#description]

메서드를 상호 작용으로 추적합니다.

매개변수 [#parameters]

매개변수

유형

설명

string actionName

string

필수의. 상호 작용에 부여할 이름입니다.

예시 [#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);
}

통사론

startInteraction(interactionName: string): Promise<InteractionId>;

설명 [#description]

메서드를 상호 작용으로 추적합니다.

매개변수 [#parameters]

매개변수

유형

설명

interactionName

string

필수의. 상호 작용에 부여할 이름입니다.

예시 [#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);
});;
};

통사론

StartInteractionWithName((string interactionName): string;

설명 [#description]

메서드를 상호 작용으로 추적합니다.

매개변수 [#parameters]

매개변수

유형

설명

interactionName

string

필수의. 상호 작용에 부여할 이름입니다.

예시 [#example]

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

통사론

StartInteraction(string interactionName): string;

설명 [#description]

메서드를 상호 작용으로 추적합니다.

매개변수 [#parameters]

매개변수

유형

설명

interactionName

string

필수의. 상호 작용에 부여할 이름입니다.

예시 [#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.