-
public interface IOMonitoringContext
Provides a context for instrumenting I/O operations.- See Also:
IOChannelStatsCollector
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FileChannel
monitorChannel(FileChannel ch, String label)
Instruments an existing file channel with monitoring.InputStream
monitorInput(InputStream in, String label)
Instruments an existing input stream with monitoring.OutputStream
monitorOutput(OutputStream out, String label)
Instruments an existing input stream with monitoring.IOChannelStatsCollector
newCollector(String interfaceName, IOChannelOperation op)
Creates a new I/O statistics collector with the specified attributes.
-
-
-
Method Detail
-
newCollector
IOChannelStatsCollector newCollector(String interfaceName, IOChannelOperation op)
Creates a new I/O statistics collector with the specified attributes. The context name of the collector is provided from the context. Typically, the interface name would be the filename (for a file channel) or network address (for a socket or datagram channel). This label does not necessarily need to be unique.- Parameters:
interfaceName
- label used to identify statisticsop
- I/O operation being monitored (reading, writing, etc.)- Returns:
- a new collector
-
monitorInput
InputStream monitorInput(InputStream in, String label)
Instruments an existing input stream with monitoring. Reads on the resulting stream will collect performance statistics.- Parameters:
in
- the input stream to monitorlabel
- the interface name to associate with the stream- Returns:
- a new input stream which collects performance measurements
-
monitorOutput
OutputStream monitorOutput(OutputStream out, String label)
Instruments an existing input stream with monitoring. Writes on the resulting stream will collect performance statistics.- Parameters:
out
- the output stream to monitorlabel
- the interface name to associate with the stream- Returns:
- a new output stream which collects performance measurements
-
monitorChannel
FileChannel monitorChannel(FileChannel ch, String label)
Instruments an existing file channel with monitoring. Reads and writes on the resulting channel will collect performance statistics; the channel will have two separate sets of statistics, one for read and one for write.- Parameters:
ch
- the channel to monitorlabel
- the interface name to associate with the channel- Returns:
- a new channel which collects performance measurements
-
-