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

Unified Diff: tools/page_cycler/database/head.js

Issue 148093016: [Telemetry] Clean up some page cycler cruft now that idb has moved out. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove database page cycler too Created 6 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: tools/page_cycler/database/head.js
diff --git a/tools/page_cycler/database/head.js b/tools/page_cycler/database/head.js
deleted file mode 100644
index a36ce77cbff070108e11253c90906880f2fd2e6a..0000000000000000000000000000000000000000
--- a/tools/page_cycler/database/head.js
+++ /dev/null
@@ -1,125 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var totalTime;
-var fudgeTime;
-var elapsedTime;
-var endTime;
-var iterations;
-var cycle;
-var results = false;
-var TIMEOUT = 15;
-
-/**
- * Returns the value of the given property stored in the cookie.
- * @param {string} name The property name.
- * @return {string} The value of the given property, or empty string
- * if the property was not found.
- */
-function __get_cookie(name) {
- var cookies = document.cookie.split('; ');
- for (var i = 0; i < cookies.length; ++i) {
- var t = cookies[i].split('=');
- if ((t[0] == name) && t[1])
- return t[1];
- }
- return '';
-}
-
-function __get_timings() {
- if (sessionStorage == null)
- return __get_cookie("__pc_timings");
- else {
- if (sessionStorage.getItem("__pc_timings") == null)
- return "";
- else
- return sessionStorage["__pc_timings"];
- }
-}
-function __set_timings(timings) {
- if (sessionStorage == null)
- document.cookie = "__pc_timings=" + timings + "; path=/";
- else
- sessionStorage["__pc_timings"]=timings;
-}
-
-/**
- * Starts the next test cycle or redirects the browser to the results page.
- */
-function nextCycleOrResults() {
- // Call GC twice to cleanup JS heap before starting a new test.
- if (window.gc) {
- window.gc();
- window.gc();
- }
-
- var timings = elapsedTime;
- var oldTimings = __get_timings();
- if (oldTimings != '')
- timings = oldTimings + ',' + timings;
- __set_timings(timings);
-
- var tLag = Date.now() - endTime - TIMEOUT;
- if (tLag > 0)
- fudgeTime += tLag;
-
- var doc;
- if (cycle == iterations) {
- document.cookie = '__pc_done=1; path=/';
- doc = '../../common/report.html';
- if (window.console) {
- console.log("Pages: [" + __get_cookie('__pc_pages') + "]");
- console.log("times: [" + __get_timings() + "]");
- }
- } else {
- doc = 'index.html';
- }
-
- var url = doc + '?n=' + iterations + '&i=' + cycle +
- '&td=' + totalTime + '&tf=' + fudgeTime;
- document.location.href = url;
-}
-
-/**
- * Computes various running times and updates the stats reported at the end.
- * @param {!number} cycleTime The running time of the test cycle.
- */
-function testComplete(cycleTime) {
- if (results)
- return;
-
- var oldTotalTime = 0;
- var cycleEndTime = Date.now();
- var cycleFudgeTime = 0;
-
- var s = document.location.search;
- if (s) {
- var params = s.substring(1).split('&');
- for (var i = 0; i < params.length; i++) {
- var f = params[i].split('=');
- switch (f[0]) {
- case 'skip':
- return; // No calculation, just viewing
- case 'n':
- iterations = f[1];
- break;
- case 'i':
- cycle = f[1] - 0 + 1;
- break;
- case 'td':
- oldTotalTime = f[1] - 0;
- break;
- case 'tf':
- cycleFudgeTime = f[1] - 0;
- break;
- }
- }
- }
- elapsedTime = cycleTime;
- totalTime = oldTotalTime + elapsedTime;
- endTime = cycleEndTime;
- fudgeTime = cycleFudgeTime;
-
- setTimeout(nextCycleOrResults, TIMEOUT);
-}
« no previous file with comments | « tools/page_cycler/database/delete-transactions/start.html ('k') | tools/page_cycler/database/insert-transactions/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698