chrome.devtools.network.onRequestFinished returning negative time
Reported by
lbroc...@fastly.com,
Aug 30 2017
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36 Steps to reproduce the problem: 1. Build DevTool extension that uses chrome.devtools.network.onRequestFinished 2. Inspect the "time" property of the entry 3. Observe that it is negative What is the expected behavior? "time" should be a positive number. Entries are in HTTP Archive format (HAR). The "time" property, according to http://www.softwareishard.com/blog/har-12-spec/ should be "Total elapsed time of the request in milliseconds. This is the sum of all timings available in the timings object (i.e. not including -1 values)" What went wrong? It includes the -1 values. { "startedDateTime": "2017-08-30T12:28:20.782Z", "time": -2.9640000169165432, ... } Did this work before? No Chrome version: 60.0.3112.101 Channel: stable OS Version: OS X 10.11.6 Flash Version: The current line is: https://github.com/ChromeDevTools/devtools-frontend/blob/e3189d64626ae16065a731d22f3c6557d032f757/front_end/network_log/HAREntry.js#L66 var time = timings.blocked + timings.dns + timings.connect + timings.send + timings.wait + timings.receive; ... which includes the special "-1" entries, so sometimes give a negative time. Perhaps it should be something like the following? const time = (entry.timings.blocked === -1 ? 0 : entry.timings.blocked) + (entry.timings.dns === -1 ? 0 : entry.timings.dns) + (entry.timings.connect === -1 ? 0 : entry.timings.connect) + (entry.timings.send === -1 ? 0 : entry.timings.send) + (entry.timings.wait === -1 ? 0 : entry.timings.wait) + (entry.timings.receive === -1 ? 0 : entry.timings.receive) + (entry.timings.ssl === -1 ? 0 : entry.timings.ssl);
,
Sep 1 2017
,
Sep 1 2017
,
Dec 13 2017
,
Jan 4 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1060ac80119b1cf5a09813f7a96fe1f33a2b40af commit 1060ac80119b1cf5a09813f7a96fe1f33a2b40af Author: Eugene Ostroukhov <eostroukhov@chromium.org> Date: Thu Jan 04 01:08:36 2018 DevTools: ensure request time is never negative. 1. Do not initialize 'receive' timestamp with -1. Quoting the spec: "The send, wait and receive timings are not optional and must have non-negative values." 2. Account for a possibility of blocked, dns, connect and ssl fields beeing -1. Bug: 760547 Change-Id: I82693812a2f7aea1edfea53d85212e0f09d43360 Reviewed-on: https://chromium-review.googlesource.com/835471 Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org> Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org> Commit-Queue: Eugene Ostroukhov <eostroukhov@chromium.org> Cr-Commit-Position: refs/heads/master@{#526883} [modify] https://crrev.com/1060ac80119b1cf5a09813f7a96fe1f33a2b40af/third_party/WebKit/Source/devtools/front_end/network_log/HAREntry.js
,
Jan 4 2018
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by pfeldman@chromium.org
, Aug 30 2017Status: Assigned (was: Unconfirmed)