Add tag/key for desktop/mobile GPSI tests (#2917)
* Add tag/key for desktop/mobile GPSI tests * new structure
This commit is contained in:
parent
9dacb295a4
commit
3f136b2d5c
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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/);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue