# "Browser was not responsive enough during the transaction"

**URL:** <https://discuss.elastic.co/t/browser-was-not-responsive-enough-during-the-transaction/206400>\
**Category:** APM\
**Tags:** rum\
**Created:** [November 4, 2019, 12:31pm UTC](https://discuss.elastic.co/t/browser-was-not-responsive-enough-during-the-transaction/206400 "2019-11-04T12:31:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cosmo](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@cosmo](https://discuss.elastic.co/u/cosmo)\
**Post date:** [November 4, 2019, 12:31pm UTC](https://discuss.elastic.co/t/browser-was-not-responsive-enough-during-the-transaction/206400/1 "2019-11-04T12:31:11Z")

</div>

Hello

I'm trying to use the JS RUM agent to measure and track ajax requests whilst a user is on a page (after page is loaded)

Following instructions from [this post](https://discuss.elastic.co/t/distributed-tracing-question-about-how-to-implement/204734/6) I have the following

```
window.addEventListener('load', function(e) {    
    var pageTransaction = apm.startTransaction(pageName, 'on-page', { managed: true })
    var pageTask = pageTransaction.addTask('on-page-task');
});

window.addEventListener("beforeunload", function() {
    pageTransaction.removeTask(pageTask )
    pageTransaction.end()
});

```

All ajax request after page load are getting logged correctly into the new transaction, and distributed tracing is working, however when I do pageTransaction.end() I am getting logs along the lines of

```
Transaction was discarded! Browser was not responsive enough during the transaction. duration: 46331.14500006195 browserResponsivenessCounter: 85 interval: 500

```

What does this mean, and do I have any influence on the 'browserResponsiveness'?  
It doesn't seem to make any difference if I do this manually from the console, or in the beforeunload event...

---

<div class="post-metadata">

**Author:** ![Hamidreza](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hamidreza/32/21369_2.png) [@Hamidreza](https://discuss.elastic.co/u/Hamidreza)\
**Post date:** [November 11, 2019, 12:58pm UTC](https://discuss.elastic.co/t/browser-was-not-responsive-enough-during-the-transaction/206400/2 "2019-11-11T12:58:05Z")

</div>

Hi @cosmo,

Thanks for reaching out.

In the RUM agent we check the browser responsiveness during the lifetime of a transaction and there are a few reasons for that. The main reason, however, is that browsers heavily throttle tabs when the user moves away from them. This means that a transaction might have a very long duration and seemingly nothing has happened during its lifetime while in reality the user has moved away from that page.

In this case, it seems that you want to measure the time, the user has spent on the page, while you can do that with the RUM agent, it does not fit the Application Performance Monitoring that the RUM agent is designed to do. However, we are aware of this use-case and we are investigating ways to facilitate it.

Finally, you can disable this check by setting `checkBrowserResponsiveness: false` in the configuration, but please be aware that this might result in skewed values in the APM dashboard.

Cheers,  
Hamid

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 2, 2019, 8:58am UTC](https://discuss.elastic.co/t/browser-was-not-responsive-enough-during-the-transaction/206400/3 "2019-12-02T08:58:07Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
