-
public interface IOChannelStatsCollector
Gathers statistics for an I/O channel. AIOChannelStatsCollector
is normally obtained by callingIOMonitoringContext.newCollector(String, IOChannelOperation)
. However, it is also possible to create one outside of a monitoring context.The creator is responsible for ensuring I/O operations are instrumented. To avoid this requirement, consider using the various methods in
IOMonitoringContext
which wrap existing streams with instrumented versions instead of directly creating collectors.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Should be called upon close to avoid accumulation of statistics collectorsvoid
finishedIO(long bytesTransferred)
Marks the completion of an I/O operation.void
startedIO()
Marks the start of an I/O operation.
-
-
-
Method Detail
-
startedIO
void startedIO()
Marks the start of an I/O operation. A subsequent call tofinishedIO(long)
is expected to mark the end.
-
finishedIO
void finishedIO(long bytesTransferred)
Marks the completion of an I/O operation. The number of bytes transferred should be supplied, so that a running sum of bytes for this I/O channel can be maintained.- Parameters:
bytesTransferred
- the number of bytes transferred by the operation
-
close
void close()
Should be called upon close to avoid accumulation of statistics collectors
-
-