@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, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
public 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.ChannelInboundHandler
channelRead
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public void newSuperstep(SuperstepMetricsRegistry superstepMetrics)
ResetSuperstepMetricsObserver
newSuperstep
in interface ResetSuperstepMetricsObserver
superstepMetrics
- SuperstepMetricsRegistry being used.public void resetAll()
ByteCounter
resetAll
in interface ByteCounter
public String getMetrics()
getMetrics
in interface ByteCounter
public String getMetricsWindow(int minMsecsWindow)
ByteCounter
getMetricsWindow
in interface ByteCounter
minMsecsWindow
- Msecs of the minimum windowCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.