001    /*
002     * $Id: ProfileStatisticMBean.java,v 1.3 2010/06/08 21:32:53 oboehm Exp $
003     *
004     * Copyright (c) 2009 by Oliver Boehm
005     *
006     * Licensed under the Apache License, Version 2.0 (the "License");
007     * you may not use this file except in compliance with the License.
008     * You may obtain a copy of the License at
009     *
010     *   http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing, software
013     * distributed under the License is distributed on an "AS IS" BASIS,
014     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express orimplied.
015     * See the License for the specific language governing permissions and
016     * limitations under the License.
017     */
018    package patterntesting.runtime.monitor;
019    
020    import javax.management.openmbean.TabularData;
021    
022    import patterntesting.runtime.jmx.*;
023    
024    /**
025     * The Interface ProfileStatisticMBean.
026     */
027    @Description("Profile statistic for different methods")
028    public interface ProfileStatisticMBean {
029    
030        /**
031         * Reset.
032         */
033        @Description("reset the statistic to be ready for new measurement")
034        void reset();
035    
036        /**
037         * Gets the max hits.
038         *
039         * @return the max hits
040         */
041        @Description("maximal number how often a method is called")
042        int getMaxHits();
043    
044        /**
045         * Gets the max hits label.
046         *
047         * @return the max hits label
048         */
049        @Description("the name of the method which was called most")
050        String getMaxHitsLabel();
051    
052        /**
053         * Gets the max hits statistic.
054         *
055         * @return the max hits statistic
056         */
057        @Description("statistic of the most called method")
058        String getMaxHitsStatistic();
059    
060        /**
061         * Gets the max total.
062         *
063         * @return the max total
064         */
065        @Description("maximal total time of a method")
066        @Unit("milliseconds")
067        double getMaxTotal();
068    
069        /**
070         * Gets the max total label.
071         *
072         * @return the max total label
073         */
074        @Description("the name of the method which need most of the time")
075        String getMaxTotalLabel();
076    
077        /**
078         * Gets the max total statistic.
079         *
080         * @return the max total statistic
081         */
082        @Description("statistic of the method which need most of the time")
083        String getMaxTotalStatistic();
084    
085        /**
086         * Gets the max avg.
087         *
088         * @return the max avg
089         */
090        @Description("maximal average time")
091        @Unit("milliseconds")
092        double getMaxAvg();
093    
094        /**
095         * Gets the max avg label.
096         *
097         * @return the max avg label
098         */
099        @Description("the name of the method with the maximal average time")
100        String getMaxAvgLabel();
101    
102        /**
103         * Gets the max avg statistic.
104         *
105         * @return the max avg statistic
106         */
107        @Description("statistic of the method with the maximal average time")
108        String getMaxAvgStatistic();
109    
110        /**
111         * Gets the max max.
112         *
113         * @return the max max
114         */
115        @Description("maximal time of a method")
116        @Unit("milliseconds")
117        double getMaxMax();
118    
119        /**
120         * Gets the max max label.
121         *
122         * @return the max max label
123         */
124        @Description("the name of the method with the maximal time of a single run")
125        String getMaxMaxLabel();
126    
127        /**
128         * Gets the max max statistic.
129         *
130         * @return the max max statistic
131         */
132        @Description("statistic of the method with the maximal time of a single run")
133        String getMaxMaxStatistic();
134    
135        /**
136         * Gets the statistics.
137         *
138         * @return the statistics
139         */
140        @Description("the statistic table")
141        TabularData getStatistics();
142    
143        /**
144         * Log statistic.
145         */
146        @Description("log the statistic data")
147        void logStatistic();
148    
149        /**
150         * Dump statistic.
151         */
152        @Description("dump the statistic data to a temporary file")
153        void dumpStatistic();
154    
155    }