| java.lang.Object org.apache.mina.common.IoFilterAdapter org.apache.mina.filter.statistic.ProfilerTimerFilter
ProfilerTimerFilter | public class ProfilerTimerFilter extends IoFilterAdapter (Code) | | This class will measure, the time it takes for a
method in the
IoFilterAdapter class to execute. The basic
premise of the logic in this class is to get the current time
at the beginning of the method, call method on nextFilter, and
then get the current time again. An example of how to use
the filter is:
ProfilerTimerFilter profiler = new ProfilerTimerFilter(
TimeUnit.MILLISECOND, IoEventType.MESSAGE_RECEIVED);
chain.addFirst("Profiler", profiler);
author: The Apache MINA Project (dev@mina.apache.org) version: $Rev: 597988 $, $Date: 2007-11-25 07:02:29 -0700 (Sun, 25 Nov 2007) $ |
Method Summary | |
public void | addEventToProfile(IoEventType type) | public double | getAverageTime(IoEventType type) | public Set<IoEventType> | getEventsToProfile() Return the bitmask that is being used to display
timing information for this filter. | public long | getMaximumTime(IoEventType type) | public long | getMinimumTime(IoEventType type) | public long | getTotalCalls(IoEventType type) | public long | getTotalTime(IoEventType type) | public void | messageReceived(NextFilter nextFilter, IoSession session, Object message) | public void | messageSent(NextFilter nextFilter, IoSession session, WriteRequest writeRequest) | public void | removeEventToProfile(IoEventType type) | public void | sessionClosed(NextFilter nextFilter, IoSession session) | public void | sessionCreated(NextFilter nextFilter, IoSession session) | public void | sessionIdle(NextFilter nextFilter, IoSession session, IdleStatus status) | public void | sessionOpened(NextFilter nextFilter, IoSession session) | public void | setEventsToProfile(IoEventType firstEventType, IoEventType... otherEventTypes) | public void | setEventsToProfile(Set<IoEventType> eventTypes) | public void | setTimeUnit(TimeUnit unit) Sets the
TimeUnit being used. |
ProfilerTimerFilter | public ProfilerTimerFilter()(Code) | | Creates a new instance of ProfilerFilter. This is the
default constructor and will print out timings for
messageReceived and messageSent and the time increment
will be in milliseconds.
|
ProfilerTimerFilter | public ProfilerTimerFilter(TimeUnit unit)(Code) | | Creates a new instance of ProfilerFilter. This is the
default constructor and will print out timings for
messageReceived and messageSent and the time increment
will be in milliseconds.
|
ProfilerTimerFilter | public ProfilerTimerFilter(TimeUnit unit, IoEventType firstEventType, IoEventType... otherEventTypes)(Code) | | Creates a new instance of ProfilerFilter. An example
of this call would be:
new ProfilerTimerFilter(
TimeUnit.MILLISECONDS,
IoEventType.MESSAGE_RECEIVED, IoEventType.MESSAGE_SENT);
Parameters: unit - Used to determine the level of precision you need in your timing. Parameters: firstEventType - an event type to profile Parameters: otherEventTypes - event types to profile |
ProfilerTimerFilter | public ProfilerTimerFilter(TimeUnit unit, EnumSet<IoEventType> eventTypes)(Code) | | Creates a new instance of ProfilerFilter. An example
of this call would be:
new ProfilerTimerFilter(
TimeUnit.MILLISECONDS,
EnumSet.of(IoEventType.MESSAGE_RECEIVED, IoEventType.MESSAGE_SENT));
Parameters: unit - Used to determine the level of precision you need in your timing. Parameters: eventTypes - A set of IoEventType representation of the methods to profile |
getAverageTime | public double getAverageTime(IoEventType type)(Code) | | Get the average time for the specified method represented by the
IoEventType Parameters: type - The IoEventType that the user wants to get the average method call timeThe average time it took to execute the method represented by the IoEventType |
getEventsToProfile | public Set<IoEventType> getEventsToProfile()(Code) | | Return the bitmask that is being used to display
timing information for this filter.
An int representing the methods that will be logged |
getMaximumTime | public long getMaximumTime(IoEventType type)(Code) | | The maximum time the method represented by
IoEventType has executed
Parameters: type - The IoEventType that the user wants to get the maximum time this method hasexecutedThe maximum time this method has executed represented by the IoEventType |
getMinimumTime | public long getMinimumTime(IoEventType type)(Code) | | The minimum time the method represented by
IoEventType has executed
Parameters: type - The IoEventType that the user wants to get the minimum time this method hasexecutedThe minimum time this method has executed represented by the IoEventType |
getTotalCalls | public long getTotalCalls(IoEventType type)(Code) | | Gets the total number of times the method has been called that is represented by the
IoEventType Parameters: type - The IoEventType that the user wants to get the total number of method callsThe total number of method calls for the method represented by the IoEventType |
getTotalTime | public long getTotalTime(IoEventType type)(Code) | | The total time this method has been executing
Parameters: type - The IoEventType that the user wants to get the total time this method hasbeen executingThe total time for the method represented by the IoEventType |
setEventsToProfile | public void setEventsToProfile(IoEventType firstEventType, IoEventType... otherEventTypes)(Code) | | Set the bitmask in order to tell this filter which
methods to print out timing information
|
setEventsToProfile | public void setEventsToProfile(Set<IoEventType> eventTypes)(Code) | | Set the bitmask in order to tell this filter which
methods to print out timing information
Parameters: eventTypes - An int representing the new methods that should be logged |
Methods inherited from org.apache.mina.common.IoFilterAdapter | public void destroy() throws Exception(Code)(Java Doc) public void exceptionCaught(NextFilter nextFilter, IoSession session, Throwable cause) throws Exception(Code)(Java Doc) public void filterClose(NextFilter nextFilter, IoSession session) throws Exception(Code)(Java Doc) public void filterSetTrafficMask(NextFilter nextFilter, IoSession session, TrafficMask trafficMask) throws Exception(Code)(Java Doc) public void filterWrite(NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws Exception(Code)(Java Doc) public void init() throws Exception(Code)(Java Doc) public void messageReceived(NextFilter nextFilter, IoSession session, Object message) throws Exception(Code)(Java Doc) public void messageSent(NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws Exception(Code)(Java Doc) public void onPostAdd(IoFilterChain parent, String name, NextFilter nextFilter) throws Exception(Code)(Java Doc) public void onPostRemove(IoFilterChain parent, String name, NextFilter nextFilter) throws Exception(Code)(Java Doc) public void onPreAdd(IoFilterChain parent, String name, NextFilter nextFilter) throws Exception(Code)(Java Doc) public void onPreRemove(IoFilterChain parent, String name, NextFilter nextFilter) throws Exception(Code)(Java Doc) public void sessionClosed(NextFilter nextFilter, IoSession session) throws Exception(Code)(Java Doc) public void sessionCreated(NextFilter nextFilter, IoSession session) throws Exception(Code)(Java Doc) public void sessionIdle(NextFilter nextFilter, IoSession session, IdleStatus status) throws Exception(Code)(Java Doc) public void sessionOpened(NextFilter nextFilter, IoSession session) throws Exception(Code)(Java Doc)
|
|
|