mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-14 01:24:04 -08:00
don't reuse the buffer
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
This commit is contained in:
parent
57bde06d2c
commit
41c7f7d352
|
@ -45,8 +45,6 @@ type NhcbParser struct {
|
|||
lset labels.Labels
|
||||
metricString string
|
||||
|
||||
buf []byte
|
||||
|
||||
// Collates values from the classic histogram series to build
|
||||
// the converted histogram later.
|
||||
lsetNhcb labels.Labels
|
||||
|
@ -61,7 +59,6 @@ func NewNhcbParser(p Parser, keepClassicHistograms bool) Parser {
|
|||
return &NhcbParser{
|
||||
parser: p,
|
||||
keepClassicHistograms: keepClassicHistograms,
|
||||
buf: make([]byte, 0, 1024),
|
||||
tempNhcb: convertnhcb.NewTempHistogram(),
|
||||
}
|
||||
}
|
||||
|
@ -189,7 +186,8 @@ func (p *NhcbParser) processNhcb(th convertnhcb.TempHistogram) bool {
|
|||
p.h = nil
|
||||
p.fh = fh
|
||||
}
|
||||
p.bytes = p.lsetNhcb.Bytes(p.buf)
|
||||
buf := make([]byte, 0, 1024)
|
||||
p.bytes = p.lsetNhcb.Bytes(buf)
|
||||
p.lset = p.lsetNhcb
|
||||
p.metricString = p.lsetNhcb.String()
|
||||
p.tempNhcb = convertnhcb.NewTempHistogram()
|
||||
|
|
Loading…
Reference in a new issue