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 {
|
} else {
|
||||||
failedQueryCount.incrementAndGet();
|
failedQueryCount.incrementAndGet();
|
||||||
}
|
}
|
||||||
QueryMetrics queryMetrics = DruidMetrics.makeRequestMetrics(
|
emitQueryTime(requestTimeNs, success);
|
||||||
queryMetricsFactory,
|
|
||||||
warehouse.getToolChest(query),
|
|
||||||
query,
|
|
||||||
req.getRemoteAddr()
|
|
||||||
);
|
|
||||||
queryMetrics.reportQueryTime(requestTimeNs).emit(emitter);
|
|
||||||
requestLogger.log(
|
requestLogger.log(
|
||||||
new RequestLogLine(
|
new RequestLogLine(
|
||||||
new DateTime(),
|
new DateTime(),
|
||||||
|
@ -433,6 +427,7 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet implements Qu
|
||||||
try {
|
try {
|
||||||
final String errorMessage = failure.getMessage();
|
final String errorMessage = failure.getMessage();
|
||||||
failedQueryCount.incrementAndGet();
|
failedQueryCount.incrementAndGet();
|
||||||
|
emitQueryTime(System.nanoTime() - startNs, false);
|
||||||
requestLogger.log(
|
requestLogger.log(
|
||||||
new RequestLogLine(
|
new RequestLogLine(
|
||||||
new DateTime(),
|
new DateTime(),
|
||||||
|
@ -461,5 +456,17 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet implements Qu
|
||||||
|
|
||||||
super.onFailure(response, failure);
|
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