mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 07:19:17 +01:00
lib/storage: add missing tagFilter.Marshal func
This commit is contained in:
parent
12b1d67b41
commit
0522efb2d6
@ -1345,7 +1345,7 @@ func (is *indexSearch) getTagFilterWithMinMetricIDsCount(tfs *TagFilters, maxMet
|
||||
|
||||
kb.B = append(kb.B[:0], uselessSingleTagFilterKeyPrefix)
|
||||
kb.B = encoding.MarshalUint64(kb.B[:0], uint64(maxMetrics))
|
||||
kb.B = tf.Marshal(kb.B)
|
||||
kb.B = tf.Marshal(kb.B, tfs.accountID, tfs.projectID)
|
||||
if len(is.db.uselessTagFiltersCache.Get(nil, kb.B)) > 0 {
|
||||
// Skip useless work below, since the tf matches at least maxMetrics metrics.
|
||||
uselessTagFilters++
|
||||
@ -1364,7 +1364,7 @@ func (is *indexSearch) getTagFilterWithMinMetricIDsCount(tfs *TagFilters, maxMet
|
||||
// The tf matches at least maxMetrics. Skip it
|
||||
kb.B = append(kb.B[:0], uselessSingleTagFilterKeyPrefix)
|
||||
kb.B = encoding.MarshalUint64(kb.B[:0], uint64(maxMetrics))
|
||||
kb.B = tf.Marshal(kb.B)
|
||||
kb.B = tf.Marshal(kb.B, tfs.accountID, tfs.projectID)
|
||||
is.db.uselessTagFiltersCache.Set(kb.B, uselessTagFilterCacheValue)
|
||||
uselessTagFilters++
|
||||
continue
|
||||
|
@ -128,6 +128,12 @@ func (tf *tagFilter) String() string {
|
||||
return bb.String()
|
||||
}
|
||||
|
||||
func (tf *tagFilter) Marshal(dst []byte, accountID, projectID uint32) []byte {
|
||||
dst = encoding.MarshalUint32(dst, accountID)
|
||||
dst = encoding.MarshalUint32(dst, projectID)
|
||||
return tf.MarshalNoAccountIDProjectID(dst)
|
||||
}
|
||||
|
||||
// MarshalNoAccountIDProjectID appends marshaled tf to dst
|
||||
// and returns the result.
|
||||
func (tf *tagFilter) MarshalNoAccountIDProjectID(dst []byte) []byte {
|
||||
|
Loading…
Reference in New Issue
Block a user