Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
only check once if tag is metric tag
Browse files Browse the repository at this point in the history
  • Loading branch information
replay committed Nov 15, 2019
1 parent e249e9c commit acd89e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions idx/memory/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@ func (m *UnpartitionedMemoryIdx) FindTagValuesWithQuery(orgId uint32, tag, prefi

var enricher *metaTagEnricher
var mtr *metaTagRecords
if MetaTagSupport {
if MetaTagSupport && !isMetricTag {
mtr, _, enricher = m.getMetaTagDataStructures(orgId, false)
if enricher.countMetricsWithMetaTags() == 0 {
// if the enricher is empty we set it back to nil so it doesn't even get called
Expand Down Expand Up @@ -1451,7 +1451,7 @@ func (m *UnpartitionedMemoryIdx) FindTagValuesWithQuery(orgId uint32, tag, prefi
resMap[tagValue[1]] = struct{}{}
}

if enricher != nil && mtr != nil && !isMetricTag {
if enricher != nil && mtr != nil {
metaTags := mtr.getMetaTagsByRecordIds(enricher.enrich(def.Id.Key))
for _, metaTag := range metaTags {
if metaTag.Key == tag && strings.HasPrefix(metaTag.Value, prefix) {
Expand Down

0 comments on commit acd89e0

Please sign in to comment.