Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

investigate network events without timing data #190

Closed
vigneshshanmugam opened this issue Jan 19, 2021 · 3 comments
Closed

investigate network events without timing data #190

vigneshshanmugam opened this issue Jan 19, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@vigneshshanmugam
Copy link
Member

Some of the network events are not having the timing data and have them as null. One of the immediate thing to notice is that these requests are not receiving any loadingFinished or loadingFailed event.

The UI currently shows empty bar without any data on this request. Need more investigation on the agent side, to figure out what is happening.

await page.goto('https://www.mlb.com/dodgers');
@vigneshshanmugam vigneshshanmugam added the bug Something isn't working label Jan 19, 2021
@dominiqueclarke
Copy link
Contributor

dominiqueclarke commented Jan 20, 2021

Specifically for inflight requests that have no timing data at all (either all the timing data, including total is -1 or the timings key is entirely omitted) this is the user experience on hover. There is no bar and there is no tooltip, because there is no data to display in the tooltip. (See the bottom item)
Screen Shot 2021-01-20 at 11 01 37 AM

@vigneshshanmugam
Copy link
Member Author

The issue happens mostly because our runner waits only till the load event which typically means all of our inflight requests ( tracking requests mostly will be cut off as they are sent only after load event in lots of cases). We would loose out on all of the requests as our browser session would be closed and we will never receive finished events.

Solution 1

  1. Educate the users that this is a common scenario and provide some examples on how users can wait for all events in a single step which effectively increases step duration and other consequences based on that.
await driver.page.waitForLoadState('networkidle');
  1. In the UI, we create a new colour code for the inflight/dropped requests and add draw them with startTime - till the record endtime.

Cons:

  • For a heavy page like https://www.mlb.com/dodgers, user would need to be aware of this issue and would not be obvious from the start.
  • Navigation timeout would happen most of the time for heavy pages which results in failed run.

Solution 2

We already talked a bit about introducing timeout for journeys and steps which is a great feature in most of the test runners #133

  1. We expand on that scope and allow a configurable navigation timeout option to consider if it's present or we use our previous load event as our signal.
npx elastic-synthetics suites --timeout 60s
  1. The above timeout would replace the existing playwright default timeout of 30s and get applied for all navigations inside journeys and steps.

The advantage with this pattern is that, we don't need to overwhelm users with number of possibilities when it comes to capturing more requests in the waterfall.

@hmdhk
Copy link
Contributor

hmdhk commented Jan 21, 2021

I would add another option to those.

Solution 3

We can add a default waiting time for network events and capture as many events as possible but add a post-processing phase once the journey is finished to adjust the end time of each step (or mark network events as truncated). This post-processing is done in the agent and it can include both the time that we recorded for the end of the step as well as network events that were started during that step, the following pseudocode can be used:

  • For each step find the network events that were started during the step i.e. requestSentTime > step.start && requestSentTime < step.end (note that this doesn't include the currentStep property)
  • Adjust the step end to the maximum of step.end and the maximum end time of the network events from previous step
  • Alternatively, we can mark network events that end after the step.end as "truncated" and show them in the step they were started in up to the step they end in (according to their timing). APM UI also has a design for truncated spans that can be used here (with triangle shape at the end of the bar chart)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants