• 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_end_transaction(PHP 에이전트 API)

통사론

newrelic_end_transaction([bool $ignore])

현재 트랜잭션 계측을 즉시 중지하십시오.

요구 사항

에이전트 버전 3.0.5.95 이상.

설명

현재 트랜잭션 계측을 즉시 중지하고 데이터를 데몬으로 보냅니다. 이 호출은 PHP가 현재 트랜잭션을 종료할 때 에이전트가 일반적으로 수행하는 작업을 시뮬레이션합니다. 이 호출의 가장 일반적인 용도는 작업 대기열 처리를 처리하는 명령줄 스크립트의 계측을 개선하는 것입니다. 특정 작업이 끝날 때 이 메서드를 호출한 다음 큐에서 새 작업을 가져올 때 newrelic_start_transaction() 을 호출합니다.

일반적으로 트랜잭션을 종료할 때 에이전트가 관련 데이터를 기록하기를 원합니다. 그러나 $ignoretrue 로 설정하여 데이터를 삭제할 수도 있습니다.

트랜잭션 타이밍을 중지하지만 계속 계측하는 newrelic_end_of_transaction() 를 비교하십시오.

매개변수

매개변수

설명

$ignore

부울

선택 과목. 기본값은 false 입니다.

false 또는 생략하면 트랜잭션의 데이터가 데몬에 의해 기록됩니다.

true 이면 트랜잭션의 데이터가 데몬에 의해 기록 되지 않습니다 .

반환 값

트랜잭션이 성공적으로 종료되고 데이터가 New Relic 데몬으로 전송된 경우 true 을 반환합니다.

트랜잭션을 중지한 다음 다른 트랜잭션을 시작하십시오.

function example() {
// queuing logic
if (extension_loaded('newrelic')) { // Ensure PHP agent is available
newrelic_end_transaction(); // stop recording the current transaction
newrelic_start_transaction(ini_get("newrelic.appname")); // start recording a new transaction
}
// more queuing logic
}

계측을 완전히 중지

function example() {
// this code is instrumented
if (extension_loaded('newrelic')) { // Ensure PHP agent is available
newrelic_end_transaction();
}
// this code is ignored
}
Copyright © 2024 New Relic Inc.

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