001package org.javasimon.jmx; 002 003/** 004 * Interface for MX Bean representing a particular {@link org.javasimon.Stopwatch}. It is not created 005 * by default when JMX is activated - it must be created explicitly. 006 * {@link JmxRegisterCallback} can be used to automate this. 007 * 008 * @author <a href="mailto:virgo47@gmail.com">Richard "Virgo" Richter</a> 009 */ 010public interface StopwatchMXBean extends SimonSuperMXBean { 011 012 /** 013 * Returns total sum of all split times in nanoseconds. 014 * 015 * @return total time of the stopwatch in nanoseconds 016 * @see org.javasimon.Stopwatch#getTotal() 017 * @since 3.3 018 */ 019 long getTotal(); 020 021 /** 022 * Returns value of the last added split - whether it was added directly or with stop method. 023 * 024 * @return value of the last added split 025 * @see org.javasimon.Stopwatch#getLast() 026 */ 027 long getLast(); 028 029 /** 030 * Returns value of the last added split as formatted string. 031 * 032 * @return value of the last added split as string 033 */ 034 String getLastAsString(); 035 036 /** 037 * Returns usage count of the stopwatch. Counter is increased by {@code addTime} and 038 * {@code stop} - that means that it's updated every time the next time split is added. 039 * 040 * @return count of time splits 041 * @see org.javasimon.Stopwatch#getCounter() 042 * @since 3.3 043 */ 044 long getCounter(); 045 046 /** 047 * Returns maximal time split value in nanoseconds. 048 * 049 * @return maximal time split in nanoseconds 050 * @see org.javasimon.Stopwatch#getMax() 051 * @since 3.3 052 */ 053 long getMax(); 054 055 /** 056 * Returns minimal time split value in nanoseconds. 057 * 058 * @return minimal time split in nanoseconds 059 * @see org.javasimon.Stopwatch#getMin() 060 * @since 3.3 061 */ 062 long getMin(); 063 064 /** 065 * Returns ms timestamp when the max value was measured. 066 * 067 * @return ms timestamp of the max value measurement 068 * @see org.javasimon.Stopwatch#getMaxTimestamp() 069 * @since 3.3 070 */ 071 long getMaxTimestamp(); 072 073 /** 074 * Returns ms timestamp when the min value was measured. 075 * 076 * @return ms timestamp of the min value measurement 077 * @see org.javasimon.Stopwatch#getMinTimestamp() 078 * @since 3.3 079 */ 080 long getMinTimestamp(); 081 082 /** 083 * Returns current number of measured splits (concurrently running). 084 * 085 * @return current number of active splits 086 * @see org.javasimon.Stopwatch#getActive() 087 * @since 3.3 088 */ 089 long getActive(); 090 091 /** 092 * Returns peek value of active concurrent splits. 093 * 094 * @return maximum reached value of active splits 095 * @see org.javasimon.Stopwatch#getMaxActive() 096 * @since 3.3 097 */ 098 long getMaxActive(); 099 100 /** 101 * Returns ms timestamp when the last peek of the active split count occurred. 102 * 103 * @return ms timestamp of the last peek of the active split count 104 * @see org.javasimon.Stopwatch#getMaxActiveTimestamp() 105 * @since 3.3 106 */ 107 long getMaxActiveTimestamp(); 108 109 /** 110 * Returns mean value (average) of all measured values. 111 * 112 * @return mean value 113 * @see org.javasimon.Stopwatch#getMean() 114 * @since 3.3 115 */ 116 double getMean(); 117 118 /** 119 * Returns standard deviation for all measured values. 120 * 121 * @return standard deviation 122 * @see org.javasimon.Stopwatch#getStandardDeviation() 123 * @since 3.3 124 */ 125 double getStandardDeviation(); 126 127 /** 128 * Returns unbiased estimate of the population variance. 129 * 130 * @return unbiased estimated variance 131 * @see org.javasimon.Stopwatch#getVariance() 132 * @since 3.3 133 */ 134 double getVariance(); 135 136 /** 137 * Returns variance value of all measured values (entire population). 138 * 139 * @return entire population variance 140 * @see org.javasimon.Stopwatch#getVarianceN() 141 * @since 3.3 142 */ 143 double getVarianceN(); 144 145 @Override 146 StopwatchSample sample(); 147 148 @Override 149 StopwatchSample sampleIncrement(String key); 150}