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

Invalid data when a timer is equal to startTime (with rounding) #8

Open
cvazac opened this issue Feb 28, 2017 · 0 comments
Open

Invalid data when a timer is equal to startTime (with rounding) #8

cvazac opened this issue Feb 28, 2017 · 0 comments

Comments

@cvazac
Copy link
Contributor

cvazac commented Feb 28, 2017

The timing data for this PerformanceResourceTiming entry:

{
  connectEnd: 914.7050000000002,
  connectStart: 777.1100000000001,
  decodedBodySize: 23612,
  domainLookupEnd: 777.1100000000001,
  domainLookupStart: 777.1100000000001,
  encodedBodySize: 23612,
  fetchStart: 776.7700000000001,
  initiatorType: "css",
  redirectEnd: 0,
  redirectStart: 0,
  requestStart: 914.8750000000001,
  responseEnd: 1055.345,
  responseStart: 1052.2450000000001,
  secureConnectionStart: 830.8850000000001,
  startTime: 776.7700000000001,
  transferSize: 24261,
}

compresses to:

4ll,7q,7n,3u,3u,1i*1i7w,i1

which decompresses to:

{
  connectEnd: 915,
  connectStart: 0,
  decodedBodySize: 23612,
  domainLookupEnd: 0,
  domainLookupStart: 0,
  duration: 278,
  encodedBodySize: 23612,
  fetchStart: 777,
  initiatorType: "css",
  redirectStart: 0,
  requestStart: 915,
  responseEnd: 1055,
  responseStart: 1052,
  secureConnectionStart: 831
  startTime: 777,
  transferSize: 24261,
}

connectStart gets decompressed to 0 instead of 777, which would lead a consumer of the decompressed data to think that it took (915-0=915)ms to connect, whereas it was actually (915-777=138)ms. "In the wild" I have seen this with connectStart/connectEnd as well as domainLookupStart/domainLookupEnd.

I think the breakdown occurs because a 0 in the compressed data can either mean that the timestamp was actually 0 (cross-origin) or was equal (with rounding) to startTime.

@nicjansma nicjansma changed the title invalid data when a timer is equal to startTime (with rounding) Invalid data when a timer is equal to startTime (with rounding) Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant