mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
8df33bd5c1
Process data obtianed from a single connection on all the available CPU cores.
21 lines
448 B
Go
21 lines
448 B
Go
package opentsdbhttp
|
|
|
|
import (
|
|
"github.com/valyala/fastjson"
|
|
)
|
|
|
|
// getJSONParser returns JSON parser.
|
|
//
|
|
// The parser must be returned to the pool via putJSONParser when no longer needed.
|
|
func getJSONParser() *fastjson.Parser {
|
|
return parserPool.Get()
|
|
}
|
|
|
|
// putJSONParser returns p to the pool.
|
|
//
|
|
// p cannot be used after returning to the pool.
|
|
func putJSONParser(p *fastjson.Parser) {
|
|
parserPool.Put(p)
|
|
}
|
|
|
|
var parserPool fastjson.ParserPool
|