Optimize labelsToKey for single label metrics

Avoid doing an Array.join when there's only one label in labelsToKey.
This commit is contained in:
Hornwitser committed 2020-11-20 01:36:21 +01:00
1 parent a08087c5e8
commit 0079d8634a
1 file changed
+4
+4
View File
@@ -275,6 +275,10 @@ function labelsToKey(labels, metricLabels) {
}
}
if (items.length === 1) {
return items[0];
}
return items.join(",");
}