Class IoServiceStatistics.Config
java.lang.Object
org.apache.mina.core.service.IoServiceStatistics.Config
- Enclosing class:
IoServiceStatistics
This is a configuration for IoServiceStatistics. It allows configuring which statistics should be calculated.
Disabling statistics calculation improves performance as each operation of IoServiceStatistics is blocking.
- Since:
- 2.0.0-M3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate final AtomicIntegerThe time (in second) between the computation of the service's statistics -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintlongbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanvoidsetLastReadTimeCalcEnabled(boolean lastReadTimeCalcEnabled) Enable/disable the last read time calculationvoidsetLastWriteTimeCalcEnabled(boolean lastWriteTimeCalcEnabled) Enable/disable the last write time calculationvoidsetReadBytesCalcEnabled(boolean readBytesCalcEnabled) Enable/disable the number of read bytes calculationvoidsetReadMessagesCalcEnabled(boolean readMessagesCalcEnabled) Enable/disable the number of read messages calculationvoidsetScheduledWriteBytesCalcEnabled(boolean scheduledWriteBytesCalcEnabled) Enable/disable scheduled for write the number of bytes calculationvoidsetScheduledWriteMessagesCalcEnabled(boolean scheduledWriteMessagesCalcEnabled) Enable/disable scheduled for write messages calculationvoidsetStatisticsCalcEnabled(boolean statisticsCalcEnabled) Enable/disable IoServiceStatistics calculations for all parametersvoidsetThroughputCalculationInterval(int throughputCalculationInterval) Sets the interval (seconds) between each throughput calculation.voidsetWrittenBytesCalcEnabled(boolean writtenBytesCalcEnabled) Enable/disable the number of written bytes calculationvoidsetWrittenMessagesCalcEnabled(boolean writtenMessagesCalcEnabled) Enable/disable the number of written messages calculation
-
Field Details
-
isReadBytesCalcEnabled
private volatile boolean isReadBytesCalcEnabled -
isWrittenBytesCalcEnabled
private volatile boolean isWrittenBytesCalcEnabled -
isReadMessagesCalcEnabled
private volatile boolean isReadMessagesCalcEnabled -
isWrittenMessagesCalcEnabled
private volatile boolean isWrittenMessagesCalcEnabled -
isLastReadTimeCalcEnabled
private volatile boolean isLastReadTimeCalcEnabled -
isLastWriteTimeCalcEnabled
private volatile boolean isLastWriteTimeCalcEnabled -
isScheduledWriteBytesCalcEnabled
private volatile boolean isScheduledWriteBytesCalcEnabled -
isScheduledWriteMessagesCalcEnabled
private volatile boolean isScheduledWriteMessagesCalcEnabled -
throughputCalculationInterval
The time (in second) between the computation of the service's statistics -
isStatisticsCalcEnabled
private volatile boolean isStatisticsCalcEnabled
-
-
Constructor Details
-
Config
public Config()
-
-
Method Details
-
isStatisticsCalcEnabled
public boolean isStatisticsCalcEnabled()- Returns:
- Is IoServiceStatistics calculations enabled
-
setStatisticsCalcEnabled
public void setStatisticsCalcEnabled(boolean statisticsCalcEnabled) Enable/disable IoServiceStatistics calculations for all parameters- Parameters:
statisticsCalcEnabled- Enabled/disabled boolean value
-
isReadBytesCalcEnabled
public boolean isReadBytesCalcEnabled()- Returns:
- Is the number of read bytes calculation enabled
-
setReadBytesCalcEnabled
public void setReadBytesCalcEnabled(boolean readBytesCalcEnabled) Enable/disable the number of read bytes calculation- Parameters:
readBytesCalcEnabled- Enabled/disabled boolean value
-
isWrittenBytesCalcEnabled
public boolean isWrittenBytesCalcEnabled()- Returns:
- Is the number of written bytes calculation enabled
-
setWrittenBytesCalcEnabled
public void setWrittenBytesCalcEnabled(boolean writtenBytesCalcEnabled) Enable/disable the number of written bytes calculation- Parameters:
writtenBytesCalcEnabled- Enabled/disabled boolean value
-
isReadMessagesCalcEnabled
public boolean isReadMessagesCalcEnabled()- Returns:
- Is the number of read messages calculation enabled
-
setReadMessagesCalcEnabled
public void setReadMessagesCalcEnabled(boolean readMessagesCalcEnabled) Enable/disable the number of read messages calculation- Parameters:
readMessagesCalcEnabled- Enabled/disabled boolean value
-
isWrittenMessagesCalcEnabled
public boolean isWrittenMessagesCalcEnabled()- Returns:
- Is the number of written messages calculation enabled
-
setWrittenMessagesCalcEnabled
public void setWrittenMessagesCalcEnabled(boolean writtenMessagesCalcEnabled) Enable/disable the number of written messages calculation- Parameters:
writtenMessagesCalcEnabled- Enabled/disabled boolean value
-
isLastReadTimeCalcEnabled
public boolean isLastReadTimeCalcEnabled()- Returns:
- Is the last read time calculation enabled
-
setLastReadTimeCalcEnabled
public void setLastReadTimeCalcEnabled(boolean lastReadTimeCalcEnabled) Enable/disable the last read time calculation- Parameters:
lastReadTimeCalcEnabled- Enabled/disabled boolean value
-
isLastWriteTimeCalcEnabled
public boolean isLastWriteTimeCalcEnabled()- Returns:
- Is the last write time calculation enabled
-
setLastWriteTimeCalcEnabled
public void setLastWriteTimeCalcEnabled(boolean lastWriteTimeCalcEnabled) Enable/disable the last write time calculation- Parameters:
lastWriteTimeCalcEnabled- Enabled/disabled boolean value
-
isScheduledWriteBytesCalcEnabled
public boolean isScheduledWriteBytesCalcEnabled()- Returns:
- Is scheduled for write the number of bytes calculation enabled
-
setScheduledWriteBytesCalcEnabled
public void setScheduledWriteBytesCalcEnabled(boolean scheduledWriteBytesCalcEnabled) Enable/disable scheduled for write the number of bytes calculation- Parameters:
scheduledWriteBytesCalcEnabled- Enabled/disabled boolean value
-
isScheduledWriteMessagesCalcEnabled
public boolean isScheduledWriteMessagesCalcEnabled()- Returns:
- Is scheduled for write the number of messages calculation enabled
-
setScheduledWriteMessagesCalcEnabled
public void setScheduledWriteMessagesCalcEnabled(boolean scheduledWriteMessagesCalcEnabled) Enable/disable scheduled for write messages calculation- Parameters:
scheduledWriteMessagesCalcEnabled- Enabled/disabled boolean value
-
getThroughputCalculationInterval
public int getThroughputCalculationInterval()- Returns:
- the interval (seconds) between each throughput calculation. The
default value is
3seconds.
-
getThroughputCalculationIntervalInMillis
public long getThroughputCalculationIntervalInMillis()- Returns:
- the interval (milliseconds) between each throughput calculation.
The default value is
3seconds.
-
setThroughputCalculationInterval
public void setThroughputCalculationInterval(int throughputCalculationInterval) Sets the interval (seconds) between each throughput calculation. The default value is3seconds.- Parameters:
throughputCalculationInterval- The interval between two calculation
-