Phedenskog has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240314

Change subject: Added timestamp to label.
......................................................................

Added timestamp to label.

Comparing two tests with the same label makes
it hard to understand which metrics belongs
to each run. We now add a timestamp to the
label, so when compare different runs in
WebPageTest it's easy to spot which metrics
belongs to which test.

Bug: T113448
Change-Id: I3c204fe3e48f9db44d8bed5da3692998a119ee41
---
M lib/util.js
1 file changed, 21 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/performance/WebPageTest 
refs/changes/14/240314/1

diff --git a/lib/util.js b/lib/util.js
index e023eee..5f9f640 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -76,12 +76,13 @@
             timeout: 1200,
             location: 'us-east-1:Chrome',
             video: 'true',
+            label: argv.label ?   this.getTodaysDate() + '-' + argv.label : 
this.getTodaysDate(),
             runs: 11
         };
 
         Object.keys(argv).forEach(function(param) {
             if (['webPageTestKey', 'webPageTestHost', '_', 'verbose', 
'userStatus',
-            'sendMetrics', 'customMetrics', 'namespace', 
'batch'].indexOf(param) === -1) {
+            'sendMetrics', 'customMetrics', 'namespace', 'batch', 
'label'].indexOf(param) === -1) {
                 wptOptions[param] = argv[param];
             }
         });
@@ -187,5 +188,23 @@
         });
 
         return metricsToSend;
-    }
+    },
+    getTodaysDate: function() {
+
+        function addPadding(number) {
+            number = number.toString();
+            if (number.length === 1) {
+                return '0' + number;
+            } else {
+                return number;
+            }
+        }
+        var date = new Date();
+        var month = addPadding(date.getMonth() + 1);
+        var day =  addPadding(date.getDate());
+        var hours = addPadding(date.getHours());
+        var minutes = addPadding(date.getMinutes());
+
+        return date.getFullYear() + '-' + month + '-' + day + ' ' + hours + 
'.' + minutes;
+    },
 };

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c204fe3e48f9db44d8bed5da3692998a119ee41
Gerrit-PatchSet: 1
Gerrit-Project: performance/WebPageTest
Gerrit-Branch: master
Gerrit-Owner: Phedenskog <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to