GoogleChrome / web-vitals

Essential metrics for a healthy site.
https://web.dev/vitals
Apache License 2.0
7.49k stars 410 forks source link

Rename `TTFBAttribution` fields from `*Time` to `*Duration` #453

Closed philipwalton closed 5 months ago

philipwalton commented 5 months ago

This PR continues the renaming work from #450 and updates the TTFBAttribution interface with the same changes—all properties whose name ended in *Time have been renamed to *Duration, in order to make it more clear that these are durations of time rather than timestamps.

interface TTFBAttribution {
-  waitingTime: number;
+  waitingDuration: number;

-  dnsTime: number;
+  dnsDuration: number;

-  connectionTime: number;
+  connectionDuration: number;

-  requestTime: number;
+  requestDuration: number;
}

⚠️ Important: this is a breaking change for anyone using the attribution build.

philipwalton commented 5 months ago

Change itself looks good but can we update README and CHANGELOG?

Doh! Not sure how I forgot to update the README. Updated!

BTW, I've generally only been updated the CHANGELOG before doing a release, but I plan to do that as soon as these changes are in.

Would also be nice to add redirect time as per #395

Yeah, I'm open to that, but I think it'd be worth discussing (and also doing as a separate PR).