Netty: Number of outstanding requests -
in apache, there server-status page tells me current status of server. in particular, tells me number of requests ('currently' in, @ time when server-status page accessed) being processed. there way find out same in netty?
it's not built in, conceptually easy implement (or easy describe, anyways ;) )
- create sharable channelhandler:
- implements channelupstreamhandler
- implements channeldownstreamhandler
- add atomicinteger field inflightrequests incremented on up, , decremented on down.
- expose inflightrequests through jmx can monitor value.
- you should decrement inflightrequests in simplechannelupstreamhandler.exeptioncaught callback. might want add errors counter inflightrequests counter incremented on caught exceptions.
- add [same] channelhandler instance created pipelines first handler.
Comments
Post a Comment