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

docs: Add docs for Time to Interactive #471

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,50 @@ telemetries: [
}
],
]
```
```

## Time to Interactive (TTI)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Mention TTI in eventPluginsToLoad, otherwise this section is dangling, while every other section is referenced from the Configuration Options section. For example:

- The set of custom plugins to load. See [usage examples](examples.md#record-custom-events-using-a-plugin).
+ The set of custom plugins to load, including [time to interactive (TTI)](examples.md#record-time-to-interactive). See [usage examples](examples.md#record-custom-events-using-a-plugin).


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: This section isn't structurally consistent with the other sections. Specifically, sections in this doc follow the following format:

  1. (Optional) A short description of the configuration option, or plugin.
  2. A table which lists configuration options.
  3. A usage example.

#### What is Time to interactive (TTI)?

Time to interactive (TTI) is a measure of how long a page takes till it is interactive. AWS RUM Web Client provides a plugin you can use to record this measurement.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Time to interactive (TTI) is a measure of how long a page takes till it is interactive. AWS RUM Web Client provides a plugin you can use to record this measurement.
Time to interactive (TTI) is a measure of how long a page takes until it is interactive. AWS RUM Web Client provides a plugin you can use to record this measurement.


#### How is TTI measured by the AWS RUM web client?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Omit this section's information. Because this file focuses on documenting how to configure the web client, if we want to document how TTI is defined, I think we should do it elsewhere.


The web client TTI plugin implements the [*Boomerang TTI algorithm*](https://akamai.github.io/boomerang/oss/BOOMR.plugins.Continuity.html#toc11__anchor), with some modifications.
Copy link
Contributor

@williazz williazz Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with some modifications

suggestion: explicitly state that we have omitted page busy metrics from the boomerang algorithm for performance concerns


_Steps to TTI calculation:_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_Steps to TTI calculation:_
_Steps to calculate TTI:_

1) Find visually ready timestamp (highest of domcontentLoadedEnd, First Contentful Paint or Largest Contentful Paint, whichever are available).
2) Starting from the visually ready timestamp, find a 500ms quiet window. A quiet window has the following characteristics:
* No Long Tasks
* FPS (Frames Per Second) is above 20 (if enabled)
3) TTI is recorded as visually ready timestamp + time from visually ready to the start of the quiet window.

Note: TTI can be measured using the plugin only when running in a browser that supports [*Long Tasks*](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceLongTaskTiming).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: move browser support to its own section


#### How to measure TTI using plugin?

You can enable TTI measurements by updating your web client configuration and using the plugin provided.

```
import { TTIPlugin } from "aws-rum-web";

const config = {
...
sessionSampleRate: 1,
telemetries: ["performance", "errors", "http"],
eventPluginsToLoad: [new TTIPlugin()],
allowCookies: true,
enableXRay: false,
...
};

```

By default, FPS (Frames per second) measurements are disabled when computing TTI. Enabling these measurement may result in some impact to your application's performance. To enable FPS measurements, simply pass option to the plugin your web client configuration:

```
eventPluginsToLoad: [new TTIPlugin(true)],
```
Note: You must enable enable custom events to ingest TTI events in your application monitor settings. See
Copy link
Contributor

@williazz williazz Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Why are custom events required? My understanding was that TTI is not a custom event.

Recording TTI events may incur Cloudwatch RUM extra charges.

Could you explain what might cause extra charges? e.g. Recording TTI events will incur the cost of roughly one RUM (or custom?) event per user session

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

synced offline

[*custom events*](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-custom-events.html) in the CloudWatch RUM user guide. Recording TTI events may incur Cloudwatch RUM extra charges.