Java Doc for ProfilerTimerFilter.java in  » Net » mina-2.0.0-M1 » org » apache » mina » filter » statistic » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » mina 2.0.0 M1 » org.apache.mina.filter.statistic 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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) $



Constructor Summary
public  ProfilerTimerFilter()
     Creates a new instance of ProfilerFilter.
public  ProfilerTimerFilter(TimeUnit unit)
     Creates a new instance of ProfilerFilter.
public  ProfilerTimerFilter(TimeUnit unit, IoEventType firstEventType, IoEventType... otherEventTypes)
     Creates a new instance of ProfilerFilter.
public  ProfilerTimerFilter(TimeUnit unit, EnumSet<IoEventType> eventTypes)
     Creates a new instance of ProfilerFilter.

Method Summary
public  voidaddEventToProfile(IoEventType type)
    
public  doublegetAverageTime(IoEventType type)
    
public  Set<IoEventType>getEventsToProfile()
     Return the bitmask that is being used to display timing information for this filter.
public  longgetMaximumTime(IoEventType type)
    
public  longgetMinimumTime(IoEventType type)
    
public  longgetTotalCalls(IoEventType type)
    
public  longgetTotalTime(IoEventType type)
    
public  voidmessageReceived(NextFilter nextFilter, IoSession session, Object message)
    
public  voidmessageSent(NextFilter nextFilter, IoSession session, WriteRequest writeRequest)
    
public  voidremoveEventToProfile(IoEventType type)
    
public  voidsessionClosed(NextFilter nextFilter, IoSession session)
    
public  voidsessionCreated(NextFilter nextFilter, IoSession session)
    
public  voidsessionIdle(NextFilter nextFilter, IoSession session, IdleStatus status)
    
public  voidsessionOpened(NextFilter nextFilter, IoSession session)
    
public  voidsetEventsToProfile(IoEventType firstEventType, IoEventType... otherEventTypes)
    
public  voidsetEventsToProfile(Set<IoEventType> eventTypes)
    
public  voidsetTimeUnit(TimeUnit unit)
     Sets the TimeUnit being used.


Constructor Detail
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




Method Detail
addEventToProfile
public void addEventToProfile(IoEventType type)(Code)
Add an IoEventType to profile
Parameters:
  type - The IoEventType 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



messageReceived
public void messageReceived(NextFilter nextFilter, IoSession session, Object message) throws Exception(Code)



messageSent
public void messageSent(NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws Exception(Code)



removeEventToProfile
public void removeEventToProfile(IoEventType type)(Code)
Remove an IoEventType to profile
Parameters:
  type - The IoEventType to profile



sessionClosed
public void sessionClosed(NextFilter nextFilter, IoSession session) throws Exception(Code)



sessionCreated
public void sessionCreated(NextFilter nextFilter, IoSession session) throws Exception(Code)



sessionIdle
public void sessionIdle(NextFilter nextFilter, IoSession session, IdleStatus status) throws Exception(Code)



sessionOpened
public void sessionOpened(NextFilter nextFilter, IoSession session) throws Exception(Code)



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



setTimeUnit
public void setTimeUnit(TimeUnit unit)(Code)
Sets the TimeUnit being used.
Parameters:
  unit - the new TimeUnit to be used.



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)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.