mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
Changes unmarshallRow logger to noop for getRowsDiff (#1835)
This commit is contained in:
parent
648d788a45
commit
40f0726147
1 changed files with 7 additions and 2 deletions
|
@ -47,6 +47,8 @@ func stdErrLogger(s string) {
|
||||||
logger.ErrorfSkipframes(1, "%s", s)
|
logger.ErrorfSkipframes(1, "%s", s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func noOpLogger(s string) {}
|
||||||
|
|
||||||
// UnmarshalWithErrLogger unmarshal Prometheus exposition text rows from s.
|
// UnmarshalWithErrLogger unmarshal Prometheus exposition text rows from s.
|
||||||
//
|
//
|
||||||
// It calls errLogger for logging parsing errors.
|
// It calls errLogger for logging parsing errors.
|
||||||
|
@ -467,13 +469,16 @@ func (li *linesIterator) Init(s string) {
|
||||||
|
|
||||||
// NextKey advances to the next key in li.
|
// NextKey advances to the next key in li.
|
||||||
//
|
//
|
||||||
// It returns true if the next key is found and Key is successcully updated.
|
// It returns true if the next key is found and Key is successfully updated.
|
||||||
func (li *linesIterator) NextKey() bool {
|
func (li *linesIterator) NextKey() bool {
|
||||||
for {
|
for {
|
||||||
if len(li.a) == 0 {
|
if len(li.a) == 0 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
li.rows, li.tagsPool = unmarshalRow(li.rows[:0], li.a[0], li.tagsPool[:0], false, stdErrLogger)
|
// there is no need to log error here,
|
||||||
|
// it's already logged by GetRowsDiff caller.
|
||||||
|
// otherwise, there is no good way to suppress it.
|
||||||
|
li.rows, li.tagsPool = unmarshalRow(li.rows[:0], li.a[0], li.tagsPool[:0], false, noOpLogger)
|
||||||
li.a = li.a[1:]
|
li.a = li.a[1:]
|
||||||
if len(li.rows) > 0 {
|
if len(li.rows) > 0 {
|
||||||
li.Key = marshalMetricNameWithTags(li.Key[:0], &li.rows[0])
|
li.Key = marshalMetricNameWithTags(li.Key[:0], &li.rows[0])
|
||||||
|
|
Loading…
Reference in a new issue