Skip to content

Commit

Permalink
Log query stats in case of Closed Channel also
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Larsen <clarsen@yahoo-inc.com>
  • Loading branch information
jsbali authored and manolama committed May 14, 2017
1 parent 2316752 commit bf3e374
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/tsd/AbstractHttpQuery.java
Expand Up @@ -386,6 +386,9 @@ public void notFound() {
*/
public void sendStatusOnly(final HttpResponseStatus status) {
if (!chan.isConnected()) {
if(stats != null) {
stats.markSendFailed();
}
done();
return;
}
Expand Down Expand Up @@ -414,6 +417,9 @@ public void sendBuffer(final HttpResponseStatus status,
final ChannelBuffer buf,
final String contentType) {
if (!chan.isConnected()) {
if(stats != null) {
stats.markSendFailed();
}
done();
return;
}
Expand Down Expand Up @@ -442,7 +448,10 @@ public void sendBuffer(final HttpResponseStatus status,
private class SendSuccess implements ChannelFutureListener {
@Override
public void operationComplete(final ChannelFuture future) throws Exception {
stats.markSent();
if(future.isSuccess()) {
stats.markSent();}
else
stats.markSendFailed();
}
}

Expand Down

0 comments on commit bf3e374

Please sign in to comment.