mirror of https://github.com/apache/druid.git
Report unsuccessful queries in AsyncQueryForwardingServlet (#4143)
This commit is contained in:
parent
801ea5efa4
commit
81ba0224c5
|
@ -394,13 +394,7 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet implements Qu
|
|||
} else {
|
||||
failedQueryCount.incrementAndGet();
|
||||
}
|
||||
QueryMetrics queryMetrics = DruidMetrics.makeRequestMetrics(
|
||||
queryMetricsFactory,
|
||||
warehouse.getToolChest(query),
|
||||
query,
|
||||
req.getRemoteAddr()
|
||||
);
|
||||
queryMetrics.reportQueryTime(requestTimeNs).emit(emitter);
|
||||
emitQueryTime(requestTimeNs, success);
|
||||
requestLogger.log(
|
||||
new RequestLogLine(
|
||||
new DateTime(),
|
||||
|
@ -433,6 +427,7 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet implements Qu
|
|||
try {
|
||||
final String errorMessage = failure.getMessage();
|
||||
failedQueryCount.incrementAndGet();
|
||||
emitQueryTime(System.nanoTime() - startNs, false);
|
||||
requestLogger.log(
|
||||
new RequestLogLine(
|
||||
new DateTime(),
|
||||
|
@ -461,5 +456,17 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet implements Qu
|
|||
|
||||
super.onFailure(response, failure);
|
||||
}
|
||||
|
||||
private void emitQueryTime(long requestTimeNs, boolean success) throws JsonProcessingException
|
||||
{
|
||||
QueryMetrics queryMetrics = DruidMetrics.makeRequestMetrics(
|
||||
queryMetricsFactory,
|
||||
warehouse.getToolChest(query),
|
||||
query,
|
||||
req.getRemoteAddr()
|
||||
);
|
||||
queryMetrics.success(success);
|
||||
queryMetrics.reportQueryTime(requestTimeNs).emit(emitter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue