構文
newrelic.interaction().end()
現在の時刻でのSPAインタラクションを終了します。
要件
ブラウザ Pro+SPA エージェント (v963 以降)
npm を使用してブラウザ エージェントをインストールしている場合は、
BrowserAgent
クラスをインスタンス化するときにspa
機能を有効にする必要があります。features
配列に以下を追加します。import { Spa } from '@newrelic/browser-agent/features/spa';const options = {info: { ... },loader_config: { ... },init: { ... },features: [Spa]}詳細については、 npm ブラウザのインストールに関するドキュメントを参照してください。
説明
このSPAメソッドは現時点でブラウザのインタラクションを終了します。 このメソッドの呼び出し後に開始される後続のネットワークrequests 、現在の SPA インタラクションの一部として含まれません。 SPA v2.1 以降では、このメソッドを使用して、5 秒のウィンドウで長いタスクを監視する保留状態のインタラクションを終了することもできます。
戻り値
このメソッドは、 interaction()
によって作成されたものと同じAPIオブジェクトを返します。
例
router.addRoute('/profile', () => { startSlowBackgroundAjax(); // Start work that will continue past the end of the interaction renderProfileComponents().then(() => { // Do work that is part of the interaction newrelic.interaction().end(); // End the interaction once the important components an the page have finished rendering });});