Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(617)

Unified Diff: tracing/tracing/extras/chrome/estimated_input_latency.html

Issue 2713043003: Fix the task overlap check in maxExpectedQueueingTimeInSlidingWindow. (Closed)
Patch Set: Add tests Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tracing/tracing/extras/chrome/estimated_input_latency.html
diff --git a/tracing/tracing/extras/chrome/estimated_input_latency.html b/tracing/tracing/extras/chrome/estimated_input_latency.html
index ca066b23ec57b55ca9acd210d77578325a55b553..cb82fd5fce763cdad55a8c771811050e7c47b344 100644
--- a/tracing/tracing/extras/chrome/estimated_input_latency.html
+++ b/tracing/tracing/extras/chrome/estimated_input_latency.html
@@ -310,8 +310,14 @@ tr.exportTo('tr.e.chrome', function() {
var sortedTasks = tasks.slice().sort((a, b) => a.start - b.start);
for (var i = 1; i < sortedTasks.length; i++) {
- // Use epsilon to guard against floating-point precision errors.
- if (sortedTasks[i - 1].end > sortedTasks[i].start + Number.EPSILON) {
+ // Due to floating-point precision errors it might happen that the end
+ // of the previous task is larger than the start of the current task.
+ // Here is an example from a real trace of system-health benchmark:
+ // Task 1: start=1932.0179090499878 end=1932.070909049988.
+ // Task 2: start=1932.0709090232850 end=1932.118909023285.
+ // To account for precision errors we consider tasks as overlapping
+ // if the overlap is sufficiently large.
+ if (sortedTasks[i - 1].end > sortedTasks[i].start + 1e-3) {
throw Error('Tasks must not overlap');
}
}

Powered by Google App Engine
This is Rietveld 408576698