• 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.

문제 신고

current_transaction(파이썬 에이전트 API)

통사론

newrelic.agent.current_transaction(active_only=True)

현재 트랜잭션에 해당하는 개체를 반환합니다.

설명

current_transaction 을 사용하여 현재 트랜잭션 을 나타내는 객체를 검색합니다. 활성 트랜잭션이 없으면 None 을 반환합니다.

매개변수

매개변수

설명

active_only

부울

선택 과목. 기본값은 True 이며 활성 트랜잭션만 반환함을 의미합니다. False 로 설정하면 호출이 종료되거나 중지된 트랜잭션을 반환할 수 있습니다(예: end_of_transaction 가 사용된 경우).

반환 값

현재 트랜잭션에 해당하는 트랜잭션 개체를 반환합니다. 활성 트랜잭션이 없으면 None 을 반환합니다.

현재 트랜잭션 가져오기

import newrelic.agent
@newrelic.agent.background_task()
def main():
transaction = newrelic.agent.current_transaction()
Copyright © 2024 New Relic Inc.

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