also send the category tag by default

This commit is contained in:
soulgalore 2017-04-10 21:09:31 +02:00
parent f9aa04ddc5
commit 11b6b8001b
1 changed files with 10 additions and 2 deletions

View File

@ -15,11 +15,19 @@ module.exports = {
const connectivity = tsdbUtil.getConnectivity(options);
const browser = options.browser;
const urlAndGroup = tsdbUtil.getURLAndGroup(options, group, url, options.influxdb.includeQueryParams).split('.');
const tags = `"${connectivity},${browser},${urlAndGroup.join(',')}"`;
let tags = `${connectivity},${browser},${urlAndGroup.join(',')}`;
const message = `<a href='${resultPageUrl}' target='_blank'>Result ${options.browsertime.iterations} run(s)</a>`;
const timestamp = Math.round(time.valueOf() / 1000);
// if we have a category, let us send that category too
if (options.influxdb.tags) {
for (var row of options.influxdb.tags.split(',')) {
const keyAndValue = row.split('=');
if (keyAndValue[0] === 'category')
tags += `,${keyAndValue[1]}`;
}
}
const postData =
`events title="Sitespeed.io",text="${message}",tags=${tags} ${timestamp}`;
`events title="Sitespeed.io",text="${message}",tags="${tags}" ${timestamp}`;
const postOptions = {
hostname: options.influxdb.host,
port: options.influxdb.port,