mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 15:14:52 +09:00
Optimize labelsToKey for single label metrics
Avoid doing an Array.join when there's only one label in labelsToKey.
This commit is contained in:
1 parent
a08087c5e8
commit
0079d8634a
1 file changed
+4
@@ -275,6 +275,10 @@ function labelsToKey(labels, metricLabels) {
|
||||
}
|
||||
}
|
||||
|
||||
if (items.length === 1) {
|
||||
return items[0];
|
||||
}
|
||||
|
||||
return items.join(",");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user