1
0
Fork 0

Update service.go

master
Philip O'Toole 1 year ago committed by GitHub
parent f1cee7a6af
commit b1bdb52b9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -191,6 +191,7 @@ var stats *expvar.Map
const (
numLeaderNotFound = "leader_not_found"
numExecutions = "executions"
numExecuteStmtsRx = "execute_stmts_rx"
numQueuedExecutions = "queued_executions"
numQueuedExecutionsOK = "queued_executions_ok"
numQueuedExecutionsStmtsRx = "queued_executions_num_stmts_rx"
@ -240,6 +241,7 @@ func ResetStats() {
stats.Init()
stats.Add(numLeaderNotFound, 0)
stats.Add(numExecutions, 0)
stats.Add(numExecuteStmtsRx, 0)
stats.Add(numQueuedExecutions, 0)
stats.Add(numQueuedExecutionsOK, 0)
stats.Add(numQueuedExecutionsStmtsRx, 0)
@ -1342,6 +1344,7 @@ func (s *Service) execute(w http.ResponseWriter, r *http.Request) {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
stats.Add(numExecuteStmtsRx(len(stmts))
if err := command.Rewrite(stmts, !noRewriteRandom); err != nil {
http.Error(w, fmt.Sprintf("SQL rewrite: %s", err.Error()), http.StatusInternalServerError)
return

Loading…
Cancel
Save