KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > util > ResponseTimeMonitor


1 /*
2  * Copyright 2002-2005 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.springframework.util;
18
19 /**
20  * Interface implemented by objects that can provide performance information
21  * as well as a record of the number of times they are accessed.
22  *
23  * <p>Implementing objects must ensure that implementing this interface
24  * does <b>not</b> compromise thread safety. However, it may be acceptable
25  * for slight innaccuracies in reported statistics to result from the
26  * avoidance of synchronization: performance may be well be more important
27  * than exact reporting, so long as the errors are not likely to be misleading.
28  *
29  * @author Rod Johnson
30  * @since November 21, 2000
31  */

32 public interface ResponseTimeMonitor {
33
34     /**
35      * Return the number of accesses to this resource.
36      */

37     int getAccessCount();
38
39     /**
40      * Return the average response time in milliseconds.
41      */

42     int getAverageResponseTimeMillis();
43
44     /**
45      * Return the best (quickest) response time in milliseconds.
46      */

47     int getBestResponseTimeMillis();
48
49     /**
50      * Return the worst (slowest) response time in milliseconds.
51      */

52     int getWorstResponseTimeMillis();
53
54 }
55
Popular Tags