public class IoServiceStatistics
extends java.lang.Object
AbstractIoService instance.| Modifier and Type | Field and Description |
|---|---|
private double |
largestReadBytesThroughput
The biggest number of bytes read per second
|
private double |
largestReadMessagesThroughput
The biggest number of messages read per second
|
private double |
largestWrittenBytesThroughput
The biggest number of bytes written per second
|
private double |
largestWrittenMessagesThroughput
The biggest number of messages written per second
|
private long |
lastReadBytes |
private long |
lastReadMessages |
private long |
lastReadTime
The time the last read operation occurred
|
private long |
lastThroughputCalculationTime |
private long |
lastWriteTime
The time the last write operation occurred
|
private long |
lastWrittenBytes |
private long |
lastWrittenMessages |
private long |
readBytes
The number of read bytes since the service has been started
|
private double |
readBytesThroughput
The number of bytes read per second
|
private long |
readMessages
The number of read messages since the service has been started
|
private double |
readMessagesThroughput
The number of messages read per second
|
private int |
scheduledWriteBytes |
private int |
scheduledWriteMessages |
private AbstractIoService |
service |
private java.util.concurrent.atomic.AtomicInteger |
throughputCalculationInterval
The time (in second) between the computation of the service's statistics
|
private java.util.concurrent.locks.Lock |
throughputCalculationLock |
private long |
writtenBytes
The number of written bytes since the service has been started
|
private double |
writtenBytesThroughput
The number of bytes written per second
|
private long |
writtenMessages
The number of written messages since the service has been started
|
private double |
writtenMessagesThroughput
The number of messages written per second
|
| Constructor and Description |
|---|
IoServiceStatistics(AbstractIoService service) |
| Modifier and Type | Method and Description |
|---|---|
void |
decreaseScheduledWriteMessages()
Decrements the count of messages scheduled for write.
|
long |
getCumulativeManagedSessionCount() |
int |
getLargestManagedSessionCount() |
double |
getLargestReadBytesThroughput() |
double |
getLargestReadMessagesThroughput() |
double |
getLargestWrittenBytesThroughput() |
double |
getLargestWrittenMessagesThroughput() |
long |
getLastIoTime() |
long |
getLastReadTime() |
long |
getLastWriteTime() |
long |
getReadBytes() |
double |
getReadBytesThroughput() |
long |
getReadMessages() |
double |
getReadMessagesThroughput() |
int |
getScheduledWriteBytes() |
int |
getScheduledWriteMessages() |
int |
getThroughputCalculationInterval() |
long |
getThroughputCalculationIntervalInMillis()
Returns the interval (milliseconds) between each throughput calculation.
|
long |
getWrittenBytes() |
double |
getWrittenBytesThroughput() |
long |
getWrittenMessages() |
double |
getWrittenMessagesThroughput() |
void |
increaseReadBytes(long nbBytesRead,
long currentTime)
Increases the count of read bytes by
nbBytesRead and sets
the last read time to currentTime. |
void |
increaseReadMessages(long currentTime)
Increases the count of read messages by 1 and sets the last read time to
currentTime. |
void |
increaseScheduledWriteBytes(int increment)
Increments by
increment the count of bytes scheduled for write. |
void |
increaseScheduledWriteMessages()
Increments the count of messages scheduled for write.
|
void |
increaseWrittenBytes(int nbBytesWritten,
long currentTime)
Increases the count of written bytes by
nbBytesWritten and
sets the last write time to currentTime. |
void |
increaseWrittenMessages(long currentTime)
Increases the count of written messages by 1 and sets the last write time
to
currentTime. |
private void |
resetThroughput()
Resets the throughput counters of the service if no session is currently
managed.
|
protected void |
setLastReadTime(long lastReadTime)
Sets last time at which a read occurred on the service.
|
protected void |
setLastThroughputCalculationTime(long lastThroughputCalculationTime)
Sets the time at which throughput counters where updated.
|
protected void |
setLastWriteTime(long lastWriteTime)
Sets last time at which a write occurred on the service.
|
void |
setThroughputCalculationInterval(int throughputCalculationInterval)
Sets the interval (seconds) between each throughput calculation.
|
void |
updateThroughput(long currentTime)
Updates the throughput counters.
|
private AbstractIoService service
private double readBytesThroughput
private double writtenBytesThroughput
private double readMessagesThroughput
private double writtenMessagesThroughput
private double largestReadBytesThroughput
private double largestWrittenBytesThroughput
private double largestReadMessagesThroughput
private double largestWrittenMessagesThroughput
private long readBytes
private long writtenBytes
private long readMessages
private long writtenMessages
private long lastReadTime
private long lastWriteTime
private long lastReadBytes
private long lastWrittenBytes
private long lastReadMessages
private long lastWrittenMessages
private long lastThroughputCalculationTime
private int scheduledWriteBytes
private int scheduledWriteMessages
private final java.util.concurrent.atomic.AtomicInteger throughputCalculationInterval
private final java.util.concurrent.locks.Lock throughputCalculationLock
public IoServiceStatistics(AbstractIoService service)
public final int getLargestManagedSessionCount()
public final long getCumulativeManagedSessionCount()
public final long getLastIoTime()
public final long getLastReadTime()
public final long getLastWriteTime()
public final long getReadBytes()
public final long getWrittenBytes()
public final long getReadMessages()
public final long getWrittenMessages()
public final double getReadBytesThroughput()
public final double getWrittenBytesThroughput()
public final double getReadMessagesThroughput()
public final double getWrittenMessagesThroughput()
public final double getLargestReadBytesThroughput()
public final double getLargestWrittenBytesThroughput()
public final double getLargestReadMessagesThroughput()
public final double getLargestWrittenMessagesThroughput()
public final int getThroughputCalculationInterval()
public final long getThroughputCalculationIntervalInMillis()
public final void setThroughputCalculationInterval(int throughputCalculationInterval)
protected final void setLastReadTime(long lastReadTime)
lastReadTime - The last time a read has occurredprotected final void setLastWriteTime(long lastWriteTime)
lastWriteTime - The last time a write has occurredprivate void resetThroughput()
public void updateThroughput(long currentTime)
public final void increaseReadBytes(long nbBytesRead,
long currentTime)
nbBytesRead and sets
the last read time to currentTime.nbBytesRead - The number of bytes readcurrentTime - The date those bytes were readpublic final void increaseReadMessages(long currentTime)
currentTime.currentTime - The time the message has been readpublic final void increaseWrittenBytes(int nbBytesWritten,
long currentTime)
nbBytesWritten and
sets the last write time to currentTime.nbBytesWritten - The number of bytes writtencurrentTime - The date those bytes were writtenpublic final void increaseWrittenMessages(long currentTime)
currentTime.currentTime - The date the message were writtenpublic final int getScheduledWriteBytes()
public final void increaseScheduledWriteBytes(int increment)
increment the count of bytes scheduled for write.public final int getScheduledWriteMessages()
public final void increaseScheduledWriteMessages()
public final void decreaseScheduledWriteMessages()
protected void setLastThroughputCalculationTime(long lastThroughputCalculationTime)