Add tag/key for desktop/mobile GPSI tests (#2917)

* Add tag/key for desktop/mobile GPSI tests

* new structure
This commit is contained in:
Peter Hedenskog 2020-03-13 08:59:34 +01:00 committed by GitHub
parent 9dacb295a4
commit 3f136b2d5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -32,6 +32,8 @@ function keyPathFromMessage(message, options, includeQueryParams, alias) {
if (message.location) {
typeParts.splice(2, 0, graphiteUtil.toSafeKey(message.location));
}
} else if (message.type.match(/(^gpsi)/)) {
typeParts.splice(2, 0, options.mobile ? 'mobile' : 'desktop');
}
// if we get a URL type, add the URL
if (message.url) {

View File

@ -46,6 +46,8 @@ class InfluxDBDataGenerator {
if (message.location) {
tags.location = message.location;
}
} else if (message.type.match(/(^gpsi)/)) {
tags.strategy = options.mobile ? 'mobile' : 'desktop';
}
// if we get a URL type, add the URL

View File

@ -37,7 +37,7 @@ describe('graphite', function() {
const data = generator.dataFromMessage(message, dayjs());
expect(data).to.match(/ns.pageSummary.sub_domain_com/);
expect(data).to.match(/bar.gpsi.median/);
expect(data).to.match(/bar.gpsi.desktop.median/);
expect(data).to.match(/foo_bar/);
});