jenkins-bot has submitted this change and it was merged.
Change subject: Add timestamp to label
......................................................................
Add 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.
Also avoid logging the URL for the sent
requests, the URL is wrong because the method
is async.
Bug: T113448
Change-Id: I3c204fe3e48f9db44d8bed5da3692998a119ee41
---
M lib/util.js
1 file changed, 22 insertions(+), 3 deletions(-)
Approvals:
Krinkle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/lib/util.js b/lib/util.js
index e023eee..ef0d566 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -60,7 +60,7 @@
url = url.slice(0, -1);
request(url, function(error, response, body) { // jshint
unused:false
if (!error) {
- console.log('Succesfully sent metrics to ' + url);
+ console.log('Succesfully sent metrics.');
} else {
console.error(error);
}
@@ -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;
+ }
+ 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: merged
Gerrit-Change-Id: I3c204fe3e48f9db44d8bed5da3692998a119ee41
Gerrit-PatchSet: 3
Gerrit-Project: performance/WebPageTest
Gerrit-Branch: master
Gerrit-Owner: Phedenskog <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits