int metricCount = processMetric(request);
HttpResponse response = new DefaultHttpResponse(HTTP_1_1, OK);
response.setContent(ChannelBuffers.copiedBuffer("\n" + metricCount + "\n", CharsetUtil.UTF_8));
response.setHeader(CONTENT_TYPE, "text/plain");
ChannelFuture future = Channels.future(channel);
ctx.sendDownstream(new DownstreamMessageEvent(channel, future, response, channel.getRemoteAddress()));
future.addListener(ChannelFutureListener.CLOSE);
}
}
ctx.sendUpstream(e);
}