KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > services > instrumentation > statistics > StatisticsInterceptor


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.services.instrumentation.statistics;
19
20 import java.util.Collection JavaDoc;
21
22 /**
23  * <P>This interceptor is designed to track and expose information about the
24  * general usage of a Carbon Component. It is designed to track the call
25  * information about a component such as the number of times and the duration
26  * of calls to each method on a component.</P>
27  *
28  * Copyright 2003 Sapient
29  * @since carbon 1.0
30  * @author Greg Hinkle, January 2002
31  * @version $Revision: 1.4 $($Author: dvoet $ / $Date: 2003/05/05 21:21:30 $)
32  */

33 public interface StatisticsInterceptor {
34
35     /**
36      * Resets the statistics being tracked on the component to zero.
37      */

38     void resetStats();
39
40     /**
41      * Returns the start time of this component
42      * @return the start time, in milleseconds, of the component
43      */

44     long getStartTime();
45
46     /**
47      * The start date of the assisted component.
48      * @return the date object of when the assisted component
49      * was started
50      */

51     java.util.Date JavaDoc getStartDate();
52
53     /**
54      * The count of calls to the component.
55      * @return the number of times any method on the assisted
56      * component were called.
57      */

58     long getCallCounts();
59
60     /**
61      * A collection of the method statistics for the assisted component.
62      * {@link org.sape.carbon.services.instrumentation.statistics.DefaultStatisticsInterceptor.MethodStats}
63      * @return an unmodifiable collection of method MethodStats objects.
64      * @see org.sape.carbon.services.instrumentation.statistics.DefaultStatisticsInterceptor.MethodStats
65      */

66     Collection JavaDoc getMethodStats();
67
68     /**
69      * Logs the statistics for the tracked component to the default
70      * logging component.
71      */

72     void logStats();
73
74     /**
75      * <p>Builds an HTML report of information about the assisted
76      * component. This report contains general information about
77      * the component as well as statistics on the total method
78      * calls and information about each method of the component.</p>
79      *
80      * <p><B>Note: </B>It should be noted that the failure counts
81      * are only updated apon the next call to a method that has
82      * failed. If a component is failing, there well may be uncounted
83      * failures, up to a count of the total threads that have had
84      * failures on the component.</p>
85      * @return an html report of information about the tracked component
86      */

87     String JavaDoc getStatsReport();
88
89 }
90
Popular Tags