mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
properly calculate readCalls
This commit is contained in:
parent
d449d0a0e1
commit
2012e294d1
3 changed files with 3 additions and 3 deletions
|
@ -25,7 +25,6 @@ var (
|
||||||
//
|
//
|
||||||
// callback shouldn't hold rows after returning.
|
// callback shouldn't hold rows after returning.
|
||||||
func ParseStream(req *http.Request, callback func(rows []Row) error) error {
|
func ParseStream(req *http.Request, callback func(rows []Row) error) error {
|
||||||
readCalls.Inc()
|
|
||||||
q := req.URL.Query()
|
q := req.URL.Query()
|
||||||
format := q.Get("format")
|
format := q.Get("format")
|
||||||
cds, err := ParseColumnDescriptors(format)
|
cds, err := ParseColumnDescriptors(format)
|
||||||
|
@ -53,6 +52,7 @@ func ParseStream(req *http.Request, callback func(rows []Row) error) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *streamContext) Read(r io.Reader, cds []ColumnDescriptor) bool {
|
func (ctx *streamContext) Read(r io.Reader, cds []ColumnDescriptor) bool {
|
||||||
|
readCalls.Inc()
|
||||||
if ctx.err != nil {
|
if ctx.err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ var (
|
||||||
//
|
//
|
||||||
// callback shouldn't hold rows after returning.
|
// callback shouldn't hold rows after returning.
|
||||||
func ParseStream(r io.Reader, isGzipped bool, precision, db string, callback func(db string, rows []Row) error) error {
|
func ParseStream(r io.Reader, isGzipped bool, precision, db string, callback func(db string, rows []Row) error) error {
|
||||||
readCalls.Inc()
|
|
||||||
if isGzipped {
|
if isGzipped {
|
||||||
zr, err := common.GetGzipReader(r)
|
zr, err := common.GetGzipReader(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -62,6 +61,7 @@ func ParseStream(r io.Reader, isGzipped bool, precision, db string, callback fun
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *streamContext) Read(r io.Reader, tsMultiplier int64) bool {
|
func (ctx *streamContext) Read(r io.Reader, tsMultiplier int64) bool {
|
||||||
|
readCalls.Inc()
|
||||||
if ctx.err != nil {
|
if ctx.err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ var maxLineLen = flag.Int("import.maxLineLen", 100*1024*1024, "The maximum lengt
|
||||||
//
|
//
|
||||||
// callback shouldn't hold rows after returning.
|
// callback shouldn't hold rows after returning.
|
||||||
func ParseStream(req *http.Request, callback func(rows []Row) error) error {
|
func ParseStream(req *http.Request, callback func(rows []Row) error) error {
|
||||||
readCalls.Inc()
|
|
||||||
r := req.Body
|
r := req.Body
|
||||||
if req.Header.Get("Content-Encoding") == "gzip" {
|
if req.Header.Get("Content-Encoding") == "gzip" {
|
||||||
zr, err := common.GetGzipReader(r)
|
zr, err := common.GetGzipReader(r)
|
||||||
|
@ -43,6 +42,7 @@ func ParseStream(req *http.Request, callback func(rows []Row) error) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *streamContext) Read(r io.Reader) bool {
|
func (ctx *streamContext) Read(r io.Reader) bool {
|
||||||
|
readCalls.Inc()
|
||||||
if ctx.err != nil {
|
if ctx.err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue