Tag CPU data and Lighthouse score in InfluxDB (#2225)

* Add specific tags for CPU data in InfluxDB

Pre this version you could get the CPU data but it was kind of hard
to understand the tags. With this fix we add a cpu tag that either is
category or event. That way it's easier to pickup (and understand)
that data.

* Add audit tag for Lighthouse tests sent to InfluxDB

Before the fix we just sent "score" but no tag telling which score.
We now add a tag named audit that tells which audit that is used
for the score.

See #2222 and #2224
This commit is contained in:
Peter Hedenskog 2018-11-28 11:05:31 +01:00 committed by GitHub
parent e0e82dc44f
commit 7a155cb33c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -107,6 +107,12 @@ class InfluxDBDataGenerator {
if (keyArray.length >= 5) {
tags[keyArray[2]] = keyArray[3];
}
if (key.indexOf('cpu.categories') > -1) {
tags.cpu = 'category';
} else if (key.indexOf('cpu.events') > -1) {
tags.cpu = 'event';
}
} else if (type === 'browsertime.summary') {
// firstPaint.median
// userTimings.marks.logoTime.median
@ -174,6 +180,12 @@ class InfluxDBDataGenerator {
if (key.indexOf('contentTypes') > -1) {
tags.contentType = keyArray[2];
}
} else if (type === 'lighthouse.pageSummary') {
// categories.seo.score
// categories.performance.score
if (key.indexOf('score') > -1) {
tags.audit = keyArray[1];
}
} else {
// console.log('Missed added tags to ' + key + ' ' + type);
}