mirror of https://github.com/apache/druid.git
Improve some log (#2807)
This commit is contained in:
parent
632b21472b
commit
c1e690288c
|
@ -160,7 +160,7 @@ public class DirectDruidClient<T> implements QueryRunner<T>
|
||||||
final String cancelUrl = String.format("http://%s/druid/v2/%s", host, query.getId());
|
final String cancelUrl = String.format("http://%s/druid/v2/%s", host, query.getId());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log.debug("Querying url[%s]", url);
|
log.debug("Querying queryId[%s] url[%s]", query.getId(), url);
|
||||||
|
|
||||||
final long requestStartTime = System.currentTimeMillis();
|
final long requestStartTime = System.currentTimeMillis();
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ public class DirectDruidClient<T> implements QueryRunner<T>
|
||||||
@Override
|
@Override
|
||||||
public ClientResponse<InputStream> handleResponse(HttpResponse response)
|
public ClientResponse<InputStream> handleResponse(HttpResponse response)
|
||||||
{
|
{
|
||||||
log.debug("Initial response from url[%s]", url);
|
log.debug("Initial response from url[%s] for queryId[%s]", url, query.getId());
|
||||||
responseStartTime = System.currentTimeMillis();
|
responseStartTime = System.currentTimeMillis();
|
||||||
emitter.emit(builder.build("query/node/ttfb", responseStartTime - requestStartTime));
|
emitter.emit(builder.build("query/node/ttfb", responseStartTime - requestStartTime));
|
||||||
|
|
||||||
|
@ -272,7 +272,8 @@ public class DirectDruidClient<T> implements QueryRunner<T>
|
||||||
{
|
{
|
||||||
long stopTime = System.currentTimeMillis();
|
long stopTime = System.currentTimeMillis();
|
||||||
log.debug(
|
log.debug(
|
||||||
"Completed request to url[%s] with %,d bytes returned in %,d millis [%,f b/s].",
|
"Completed queryId[%s] request to url[%s] with %,d bytes returned in %,d millis [%,f b/s].",
|
||||||
|
query.getId(),
|
||||||
url,
|
url,
|
||||||
byteCount.get(),
|
byteCount.get(),
|
||||||
stopTime - responseStartTime,
|
stopTime - responseStartTime,
|
||||||
|
|
|
@ -107,9 +107,11 @@ public class QueryResource
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public Response getServer(@PathParam("id") String queryId)
|
public Response getServer(@PathParam("id") String queryId)
|
||||||
{
|
{
|
||||||
|
if (log.isDebugEnabled()) {
|
||||||
|
log.debug("Received cancel request for query [%s]", queryId);
|
||||||
|
}
|
||||||
queryManager.cancelQuery(queryId);
|
queryManager.cancelQuery(queryId);
|
||||||
return Response.status(Response.Status.ACCEPTED).build();
|
return Response.status(Response.Status.ACCEPTED).build();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
|
@ -135,6 +137,7 @@ public class QueryResource
|
||||||
? objectMapper.writerWithDefaultPrettyPrinter()
|
? objectMapper.writerWithDefaultPrettyPrinter()
|
||||||
: objectMapper.writer();
|
: objectMapper.writer();
|
||||||
|
|
||||||
|
final String currThreadName = Thread.currentThread().getName();
|
||||||
try {
|
try {
|
||||||
query = objectMapper.readValue(in, Query.class);
|
query = objectMapper.readValue(in, Query.class);
|
||||||
queryId = query.getId();
|
queryId = query.getId();
|
||||||
|
@ -151,6 +154,8 @@ public class QueryResource
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Thread.currentThread()
|
||||||
|
.setName(String.format("%s[%s_%s_%s]", currThreadName, query.getType(), query.getDataSource(), queryId));
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("Got query [%s]", query);
|
log.debug("Got query [%s]", query);
|
||||||
}
|
}
|
||||||
|
@ -337,5 +342,8 @@ public class QueryResource
|
||||||
)
|
)
|
||||||
).build();
|
).build();
|
||||||
}
|
}
|
||||||
|
finally {
|
||||||
|
Thread.currentThread().setName(currThreadName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue