Skip to content

Commit

Permalink
Do not backfill the slug (#3901)
Browse files Browse the repository at this point in the history
* Do not backfill the slug #3899
  • Loading branch information
soulgalore authored Jul 7, 2023
1 parent c098331 commit 9e215b8
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 11 deletions.
3 changes: 0 additions & 3 deletions lib/core/resultsStorage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ export function resultsStorage(input, timestamp, options) {
storageBasePath = resolve('sitespeed-result', ...resultsSubFolders);
}

// backfill the slug
options.slug = options.slug || getDomainOrFileName(input).replace(/\./g, '_');

storagePathPrefix = join(...resultsSubFolders);

if (resultBaseURL) {
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/grafana/send-annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function send(
urlAndGroup[1]
];
// Avoid having the same annotations twice https://github.com/sitespeedio/sitespeed.io/issues/3277#
if (options.slug && options.slug !== urlAndGroup[0]) {
if (options.slug) {
tags.push(options.slug);
}
const extraTags = toArray(options.grafana.annotationTag);
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/graphite/data-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function keyPathFromMessage(message, options, includeQueryParameters, alias) {
typeParts.splice(1, 0, toSafeKey(message.group));
}

if (options.graphite && options.graphite.addSlugToKey) {
if (options.graphite && options.graphite.addSlugToKey && options.slug) {
typeParts.unshift(options.slug);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/graphite/send-annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export function send(
urlAndGroup[0],
urlAndGroup[1]
];
// See https://github.com/sitespeedio/sitespeed.io/issues/3277
if (options.slug && options.slug !== urlAndGroup[0]) {

if (options.slug) {
tags.push(options.slug);
}
const extraTags = toArray(options.graphite.annotationTag);
Expand Down
4 changes: 3 additions & 1 deletion lib/plugins/influxdb/data-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ export class InfluxDBDataGenerator {
tags.group = toSafeKey(message.group, options.influxdb.groupSeparator);
}

tags.testName = options.slug;
if (options.slug) {
tags.testName = options.slug;
}

return tags;
}
Expand Down
3 changes: 1 addition & 2 deletions lib/plugins/influxdb/send-annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ export function send(
).split('.');
let tags = [connectivity, browser, urlAndGroup[0], urlAndGroup[1]];

// See https://github.com/sitespeedio/sitespeed.io/issues/3277
if (options.slug && options.slug !== urlAndGroup[0]) {
if (options.slug) {
tags.push(options.slug);
}

Expand Down
2 changes: 1 addition & 1 deletion test/influxdbTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,5 +355,5 @@ test(`Test influxdb dataGenerator`, t => {
const seriesName = data[0].seriesName;
const numberOfTags = Object.keys(data[0].tags).length;
t.is(seriesName, 'score');
t.is(numberOfTags, 7);
t.is(numberOfTags, 6);
});

0 comments on commit 9e215b8

Please sign in to comment.