| 156 | StartedAt: started, |
| 157 | } |
| 158 | |
| 159 | execResult, err := driver.Execute(ctx, query, args) |
| 160 | if execResult.Duration <= 0 { |
| 161 | execResult.Duration = time.Since(started) |
| 162 | } |
| 163 | result.Duration = execResult.Duration |
| 164 | result.Rows = execResult.Rows |
| 165 | result.ServiceMetrics = execResult.ServiceMetrics |
| 166 | if err != nil { |
| 167 | result.Status = "error" |
| 168 | result.Error = err.Error() |
| 169 | result.ErrorClass = "execution_error" |
| 170 | } else { |
| 171 | result.Status = "ok" |
| 172 | } |
| 173 | r.metrics.Observe(result) |
| 174 | |
| 175 | if measure { |