@ChannelHandler.Sharable public class InboundByteCounter extends io.netty.channel.ChannelInboundHandlerAdapter implements ByteCounter, ResetSuperstepMetricsObserver
| Constructor and Description |
|---|
InboundByteCounter()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
long |
getBytesReceived() |
long |
getBytesReceivedPerSuperstep()
Returns bytes received per superstep.
|
double |
getMbytesPerSecReceived() |
String |
getMetrics() |
String |
getMetricsWindow(int minMsecsWindow)
Get the metrics if a given window of time has passed.
|
void |
newSuperstep(SuperstepMetricsRegistry superstepMetrics)
Starting a new superstep.
|
void |
resetAll()
Reset everything this object keeps track of
|
void |
resetBytesReceivedPerSuperstep()
Set bytes received per superstep to 0.
|
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharablepublic long getBytesReceived()
public long getBytesReceivedPerSuperstep()
public void resetBytesReceivedPerSuperstep()
public double getMbytesPerSecReceived()
public void channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
channelRead in interface io.netty.channel.ChannelInboundHandlerchannelRead in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void newSuperstep(SuperstepMetricsRegistry superstepMetrics)
ResetSuperstepMetricsObservernewSuperstep in interface ResetSuperstepMetricsObserversuperstepMetrics - SuperstepMetricsRegistry being used.public void resetAll()
ByteCounterresetAll in interface ByteCounterpublic String getMetrics()
getMetrics in interface ByteCounterpublic String getMetricsWindow(int minMsecsWindow)
ByteCountergetMetricsWindow in interface ByteCounterminMsecsWindow - Msecs of the minimum windowCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.