forked from mirrors/statsd_exporter
Merge pull request #279 from bakins/format-key-optimization
mapper cache: Use string concatenation rather than Sprintf for formatKey
This commit is contained in:
commit
2e3d3ab962
1 changed files with 2 additions and 3 deletions
|
@ -14,8 +14,7 @@
|
|||
package mapper
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/hashicorp/golang-lru"
|
||||
lru "github.com/hashicorp/golang-lru"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
|
@ -81,7 +80,7 @@ func (m *MetricMapperLRUCache) trackCacheLength() {
|
|||
}
|
||||
|
||||
func formatKey(metricString string, metricType MetricType) string {
|
||||
return fmt.Sprintf("%s.%s", string(metricType), metricString)
|
||||
return string(metricType) + "." + metricString
|
||||
}
|
||||
|
||||
func NewMetricMapperNoopCache() *MetricMapperNoopCache {
|
||||
|
|
Loading…
Reference in a new issue