Skip to content

Commit

Permalink
Add nrecords, idx, limit into log output (can be used in loki)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Mar 26, 2021
1 parent f5fdb41 commit ec5776f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,14 @@ func processRequest(dasquery dasql.DASQuery, pid string, idx, limit int) map[str
status, data := das.GetData(dasquery, "merge", idx, limit)
ts := das.TimeStamp(dasquery)
procTime := time.Now().Sub(time.Unix(ts, 0))
response["nresults"] = das.Count(pid)
nrec := das.Count(pid)
response["nresults"] = nrec
response["timestamp"] = das.GetTimestamp(pid)
response["status"] = status
response["pid"] = pid
response["data"] = data
response["procTime"] = procTime
log.Printf("%v pid=%v processing_time=%v\n", dasquery, pid, procTime)
log.Printf("%v pid=%v status=%v nrecords=%d idx=%v limit=%v processing_time=%v\n", dasquery, pid, status, nrec, idx, limit, procTime)
} else if das.CheckData(pid) { // data exists in cache but still processing
response["status"] = "processing"
response["pid"] = pid
Expand Down

0 comments on commit ec5776f

Please sign in to comment.