GoogleChrome / GoogleChrome/lighthouse

Automatically add server timings information to report

Open
#10,323 4 comments 5 reactions 0 assignees View on GitHub
feature new_audit P3
Dominant language
JavaScript
Stars
30.8k
Forks
9.8k
Avg merge
1d 14h
Merged PRs (30d)
20

Description

**Feature request summary**
**Describe what you want to be added**
Currently I see that in the json report, we have a field named `user-timings`. If I am understanding it correctly, this allows our javascript to set custom metrics via the user timing API.

What I don't see is the information from server timing headers. For example, provided the server send down [server timing headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing), the information would be available via this snippet.

```
performance.getEntriesByType('navigation')[0].serverTiming;
```
**Are you willing to work on this yourself?**
I mean sure, would be a good learning experience for me 😄

**What is the motivation or use case for changing this?**
The main purpose of this feature I think is to make it easier to quickly detect on which layer did a regression happen.

For example: Let's say a request has to go through DNS resolution, then load balancer, then a web server doing server-side rendering, which also depends on other services, and only then the server can send back a response.

Without server timing API, we would have to look at various dashboards and metrics to see which one caused the regression. With server timing API, we can simply look at the server timing headers and draw conclusion. Integrate it in lighthouse report and we can have a single point of reference to detect performance regression!

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the JSON report currently collects and emits the `user-timings` field, then inspect the navigation entry exposed through `performance.getEntriesByType('navigation')[0].serverTiming`. The work is done when server timing header information is included in Lighthouse reports and is covered by the relevant report output tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
performance, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.