public class ByteCounterDelegate extends Object implements ByteCounter
Modifier and Type | Field and Description |
---|---|
static double |
MEGABYTE
Megabyte in bytes
|
Constructor and Description |
---|
ByteCounterDelegate(boolean isInBound)
Constructor to specify if delegate is created by InBound/ Outbound counter
|
Modifier and Type | Method and Description |
---|---|
int |
byteBookkeeper(io.netty.buffer.ByteBuf buf)
Updates properties based on bytes sent / received
|
long |
getBytesProcessed() |
long |
getBytesProcessedPerSuperstep()
Returns bytes processed per superstep.
|
double |
getMbytesPerSecProcessed() |
String |
getMetrics() |
String |
getMetricsHelper(double mBytesProcessed,
double mBytesProcessedPerReq)
Helper method used by getMetrics to create its return string
|
String |
getMetricsWindow(int minMsecsWindow)
Get the metrics if a given window of time has passed.
|
void |
newSuperstep(SuperstepMetricsRegistry superstepMetrics)
Called by Inbound/ Outbound counters to refresh meters on a new superstep
|
void |
resetAll()
Reset everything this object keeps track of
|
void |
resetBytes()
Reset all the bytes kept track of.
|
void |
resetBytesProcessedPerSuperstep()
Set bytes processed per superstep to 0.
|
void |
resetStartMsecs()
Reset the start msecs.
|
public static final double MEGABYTE
public ByteCounterDelegate(boolean isInBound)
isInBound
- switch to specify if instantiated by inbound counterpublic void newSuperstep(SuperstepMetricsRegistry superstepMetrics)
superstepMetrics
- superstepmetrics registrypublic int byteBookkeeper(io.netty.buffer.ByteBuf buf)
buf
- ByteBuf received by the counterpublic void resetBytes()
public void resetStartMsecs()
public void resetAll()
ByteCounter
resetAll
in interface ByteCounter
public long getBytesProcessedPerSuperstep()
public void resetBytesProcessedPerSuperstep()
public long getBytesProcessed()
public double getMbytesPerSecProcessed()
public String getMetricsHelper(double mBytesProcessed, double mBytesProcessedPerReq)
mBytesProcessed
- mbytes processedmBytesProcessedPerReq
- mbytes processed per requestpublic 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.