jenkins-bot has submitted this change and it was merged.

Change subject: No for of loops in old nodejs
......................................................................


No for of loops in old nodejs

Lets go back in time for Jenkins.

Change-Id: I03832cf43a5e1a8261382656714a6d5390c01d5e
---
M lib/collectMetrics.js
M lib/cpuTime.js
2 files changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Phedenskog: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/collectMetrics.js b/lib/collectMetrics.js
index e84216e..bf9ed42 100644
--- a/lib/collectMetrics.js
+++ b/lib/collectMetrics.js
@@ -62,15 +62,15 @@
                 // you need to turn on timeline collecting and use Chrome for 
this to work
                 if (argv.timeline) {
                     var cpuTimes = 
cpuTime.sum(wptJson.data.median[view].cpuTimes);
-                    for (var time of Object.keys(cpuTimes)) {
+                    Object.keys(cpuTimes).forEach(function(time) {
                         metricsToSend.cpuTimes[keyStart + 'cpuTimes.' + time] =
                         cpuTimes[time];
-                    }
+                    });
                     var cpuTimesDoc = 
cpuTime.sum(wptJson.data.median[view].cpuTimesDoc);
-                    for (var cpuTimeDoc of Object.keys(cpuTimesDoc)) {
+                    Object.keys(cpuTimesDoc).forEach(function(cpuTimeDoc) {
                         metricsToSend.cpuTimes[keyStart + 'cpuTimesDoc.' + 
cpuTimeDoc] =
                         cpuTimesDoc[cpuTimeDoc];
-                    }
+                    });
                 }
 
                 if (wptJson.data.median[view].userTimes) {
diff --git a/lib/cpuTime.js b/lib/cpuTime.js
index c59dad0..756f9d0 100644
--- a/lib/cpuTime.js
+++ b/lib/cpuTime.js
@@ -65,7 +65,7 @@
 module.exports = {
     sum: function(times) {
         var total = {};
-        for (var name of Object.keys(times)) {
+        Object.keys(times).forEach(function(name) {
             if (mapTimings[name] === undefined) {
                 console.error('Un-mapped entry in devtools timeline metrics:' 
+ name);
             } else if (total[mapTimings[name]]) {
@@ -73,7 +73,7 @@
             } else {
                 total[mapTimings[name]] = times[name];
             }
-        }
+        });
         return total;
     }
 };

-- 
To view, visit https://gerrit.wikimedia.org/r/315212
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I03832cf43a5e1a8261382656714a6d5390c01d5e
Gerrit-PatchSet: 1
Gerrit-Project: performance/WebPageTest
Gerrit-Branch: master
Gerrit-Owner: Phedenskog <phedens...@wikimedia.org>
Gerrit-Reviewer: Phedenskog <phedens...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to