Syntaxe
newrelic.interaction().end()
Met fin à l'interaction SPA à l'heure actuelle.
Exigences
Agent navigateur Pro+SPA (v963 ou supérieur)
Si vous utilisez npm pour installer l'agent du navigateur, vous devez activer la fonctionnalité
spa
lors de l'instanciation de la classeBrowserAgent
. Dans l'éventailfeatures
, ajoutez ce qui suit :import { Spa } from '@newrelic/browser-agent/features/spa';const options = {info: { ... },loader_config: { ... },init: { ... },features: [Spa]}Pour plus d'informations, consultez la documentation d'installation du navigateur npm.
Description
Cette méthode SPA mettra fin à l’interaction du navigateur à l’heure actuelle. Tout rappel ou requests ultérieure ne sera pas inclus dans le cadre de l'interaction SPA.
Valeurs de retour
Cette méthode renvoie le même objet API créé par interaction()
.
Exemples
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 });});