fast path for labels

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-07-23 08:59:50 +03:00
parent 6a35c083ad
commit e9a657e895

View File

@ -25,6 +25,11 @@ func (r *victoriametricsMeter) buildName(name string, labels ...string) string {
if len(r.opts.MetricPrefix) > 0 {
name = r.opts.MetricPrefix + name
}
if len(labels) == 0 {
return name
}
if len(r.opts.LabelPrefix) == 0 {
return meter.BuildName(name, labels...)
}