Fixed search-params loop. Added V8 table.
authorMark Cote <mcote@mozilla.com>
Wed, 09 May 2012 12:50:20 -0400
changeset 89 1615750629c5251dcd7bddf1a6cecd4c2d8ddcc9
parent 88 66bec4f39c9781db1e94c126b6a7b6d9c790c512
child 90 3f87fcac453fc43ac9950ceff5575d35cd674695
push id87
push usermcote@mozilla.com
push dateWed, 09 May 2012 16:50:39 +0000
Fixed search-params loop. Added V8 table.
html/js/speedtests.js
server/speedtests/V8/tables.sql
--- a/html/js/speedtests.js
+++ b/html/js/speedtests.js
@@ -1,17 +1,17 @@
 var SpeedTests = function() {
 
   var loadingNextTest = false;
   var all_results = [];
   var startTime = null;
   var lastReportTime = null;
   
   var isoDateTime = function (d) {
-    function pad(n) { return n < 10 ? '0' + n : n }
+    function pad(n) { return n < 10 ? '0' + n : n; }
     return d.getUTCFullYear() + '-'
          + pad(d.getUTCMonth()+1) + '-'
          + pad(d.getUTCDate()) + ' '
          + pad(d.getUTCHours()) + ':'
          + pad(d.getUTCMinutes()) + ':'
          + pad(d.getUTCSeconds());
   };
 
@@ -20,17 +20,17 @@ var SpeedTests = function() {
     results.browser_height = window.innerHeight;
     results.teststart = isoDateTime(startTime);
     all_results.push(results);
   };
 
   var getSearchParams = function() {
     var params = document.location.search.slice(1).split("&");
     var args = new Object();
-    for (p in params) {
+    for (var p = 0; p < params.length; p++) {
       var l = params[p].split("=");
       for (var i = 0; i < l.length; i++) {
         l[i] = decodeURIComponent(l[i]);
       }
       if (l.length != 2)
         continue;
       args[l[0]] = l[1];
     }
new file mode 100644
--- /dev/null
+++ b/server/speedtests/V8/tables.sql
@@ -0,0 +1,11 @@
+CREATE TABLE V8 (
+    id INT AUTO_INCREMENT,
+    PRIMARY KEY (id),
+    browser_id INT,
+    FOREIGN KEY (browser_id) REFERENCES browser(id),
+    browser_height INT,
+    browser_width INT,
+    score INT,
+    teststart TIMESTAMP,
+    ip VARCHAR(15) COLLATE utf8_bin
+);