KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > excalibur > instrument > client > InstrumentSampleElementData


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14  * implied.
15  *
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */

19
20 package org.apache.excalibur.instrument.client;
21
22 public interface InstrumentSampleElementData
23     extends ElementData
24 {
25     /** Type which identifies CounterInstrumentSamples. */
26     int INSTRUMENT_SAMPLE_TYPE_COUNTER = 101;
27     
28     /** Type which identifies MinimumInstrumentSamples. */
29     int INSTRUMENT_SAMPLE_TYPE_MINIMUM = 102;
30     
31     /** Type which identifies MaximumInstrumentSamples. */
32     int INSTRUMENT_SAMPLE_TYPE_MAXIMUM = 103;
33     
34     /** Type which identifies MeanInstrumentSamples. */
35     int INSTRUMENT_SAMPLE_TYPE_MEAN = 104;
36     
37     /**
38      * Returns the sample interval. The period of each sample in millisends.
39      *
40      * @return The sample interval.
41      */

42     long getInterval();
43     
44     /**
45      * Returns the number of samples in the sample history.
46      *
47      * @return The size of the sample history.
48      */

49     int getSize();
50     
51     /**
52      * Returns the type of the Instrument Sample. Possible values include
53      * InstrumentSampleData.INSTRUMENT_SAMPLE_TYPE_COUNTER,
54      * InstrumentSampleData.INSTRUMENT_SAMPLE_TYPE_MAXIMUM,
55      * InstrumentSampleData.INSTRUMENT_SAMPLE_TYPE_MEAN, or
56      * InstrumentSampleData.INSTRUMENT_SAMPLE_TYPE_MINIMUM.
57      *
58      * @return The type of the Instrument Sample.
59      */

60     int getType();
61     
62     /**
63      * Obtain the value of the sample. All samples are integers, so the profiled
64      * objects must measure quantity (numbers of items), rate (items/period), time in
65      * milliseconds, etc.
66      *
67      * @return The sample value.
68      */

69     int getValue();
70     
71     /**
72      * Obtain the UNIX time of the beginning of the sample.
73      *
74      * @return The UNIX time of the beginning of the sample.
75      */

76     long getTime();
77     
78     /**
79      * Obtain the UNIX time when the lease expires.
80      *
81      * @return The UNIX time when the lease expires.
82      */

83     long getLeaseExpirationTime();
84     
85     /**
86      * Returns the Type of the Instrument which can use the sample. This
87      * should be the same for all instances of a class.
88      * <p>
89      * Should be one of the following: InstrumentData.PROFILE_POINT_TYPE_COUNTER
90      * or InstrumentData.PROFILE_POINT_TYPE_VALUE
91      *
92      * @return The Type of the Instrument which can use the sample.
93      */

94     int getInstrumentType();
95 }
Popular Tags