feat(jdk8): move files to new folder to avoid resources compiled.
This commit is contained in:
46
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/AverageRangeStatistic.java
vendored
Normal file
46
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/AverageRangeStatistic.java
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AverageRangeStatistic.java
|
||||
*
|
||||
* Created on May 11, 2004, 2:15 PM
|
||||
*/
|
||||
|
||||
package com.sun.org.glassfish.external.statistics;
|
||||
|
||||
/**
|
||||
* An interface that Specifies standard measurements of the lowest and highest
|
||||
* values an attribute has held as well as its current value.
|
||||
* Extending RangeStatistic, it also provides the average value.
|
||||
*/
|
||||
|
||||
public interface AverageRangeStatistic extends RangeStatistic {
|
||||
|
||||
public long getAverage();
|
||||
|
||||
}
|
||||
43
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/BoundaryStatistic.java
vendored
Normal file
43
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/BoundaryStatistic.java
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics;
|
||||
|
||||
/**
|
||||
* Specifies standard measurements of the upper and lower limits of the value of an attribute.
|
||||
*/
|
||||
public interface BoundaryStatistic extends Statistic {
|
||||
/**
|
||||
* The upper limit of the value of this attribute.
|
||||
*/
|
||||
long getUpperBound();
|
||||
|
||||
/**
|
||||
* The lower limit of the value of this attribute.The upper limit of the value of this attribute.
|
||||
*/
|
||||
long getLowerBound();
|
||||
}
|
||||
33
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/BoundedRangeStatistic.java
vendored
Normal file
33
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/BoundedRangeStatistic.java
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics;
|
||||
|
||||
/**
|
||||
* The BoundedRangeStatistic model aggregates the attributes of RangeStatistic and BoundaryStatistic and provides standard measurements of a range that has fixed limits.
|
||||
*/
|
||||
public interface BoundedRangeStatistic extends BoundaryStatistic, RangeStatistic {
|
||||
}
|
||||
38
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/CountStatistic.java
vendored
Normal file
38
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/CountStatistic.java
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics;
|
||||
|
||||
/**
|
||||
* Specifies standard count measurements.
|
||||
*/
|
||||
public interface CountStatistic extends Statistic {
|
||||
/**
|
||||
* The count since the last reset.
|
||||
*/
|
||||
long getCount();
|
||||
}
|
||||
48
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/RangeStatistic.java
vendored
Normal file
48
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/RangeStatistic.java
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics;
|
||||
|
||||
/**
|
||||
* Specifies standard measurements of the lowest and highest values an attribute has held as well as its current value.
|
||||
*/
|
||||
public interface RangeStatistic extends Statistic {
|
||||
/**
|
||||
* The highest value this attribute has held since the beginninYg of the measurement.
|
||||
*/
|
||||
long getHighWaterMark();
|
||||
|
||||
/**
|
||||
* The lowest value this attribute has held since the beginning of the measurement.
|
||||
*/
|
||||
long getLowWaterMark();
|
||||
|
||||
/**
|
||||
* The current value of this attribute.
|
||||
*/
|
||||
long getCurrent();
|
||||
}
|
||||
59
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/Statistic.java
vendored
Normal file
59
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/Statistic.java
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics;
|
||||
|
||||
/**
|
||||
* The Statistic model and its sub-models specify the data models which are requried to be used to provide the performance data described by the specific attributes in the Stats models.
|
||||
*/
|
||||
public interface Statistic {
|
||||
/**
|
||||
* The name of this Statistic.
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* The unit of measurement for this Statistic.
|
||||
* Valid values for TimeStatistic measurements are "HOUR", "MINUTE", "SECOND", "MILLISECOND", "MICROSECOND" and "NANOSECOND".
|
||||
*/
|
||||
String getUnit();
|
||||
|
||||
/**
|
||||
* A human-readable description of the Statistic.
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
/**
|
||||
* The time of the first measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.
|
||||
*/
|
||||
long getStartTime();
|
||||
|
||||
/**
|
||||
* The time of the last measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.
|
||||
*/
|
||||
long getLastSampleTime();
|
||||
}
|
||||
46
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/Stats.java
vendored
Normal file
46
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/Stats.java
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics;
|
||||
|
||||
public interface Stats {
|
||||
|
||||
/**
|
||||
* Get a Statistic by name.
|
||||
*/
|
||||
Statistic getStatistic(String statisticName);
|
||||
|
||||
/**
|
||||
* Returns an array of Strings which are the names of the attributes from the specific Stats submodel that this object supports. Attributes named in the list must correspond to attributes that will return a Statistic object of the appropriate type which contains valid performance data. The return value of attributes in the Stats submodel that are not included in the statisticNames list must be null. For each name in the statisticNames list there must be one Statistic with the same name in the statistics list.
|
||||
*/
|
||||
String [] getStatisticNames();
|
||||
|
||||
/**
|
||||
* Returns an array containing all of the Statistic objects supported by this Stats object.
|
||||
*/
|
||||
Statistic[] getStatistics();
|
||||
}
|
||||
47
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/StringStatistic.java
vendored
Normal file
47
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/StringStatistic.java
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics;
|
||||
|
||||
/**
|
||||
* Custom statistic type created for the Sun ONE Application Server.
|
||||
* The goal is to be able to represent changing attribute values that are strings
|
||||
* in the form of Statistics. Semantically, it is analogous to a {@link CountStatistic},
|
||||
* the only difference being in the value that is returned. Unlike a CountStatistic
|
||||
* (which always is unidirectional), this Statistic type is not having any
|
||||
* specified direction, simply because there is no natural order. An example
|
||||
* of the values that an instance of this statistic type can assume is: A State
|
||||
* Statistic which can have "CONNECTED, CLOSED, DISCONNECTED" as the permissible
|
||||
* values and the current value can be any one of them (and them only).
|
||||
* The permissible values are upto a particular implementation.
|
||||
*/
|
||||
|
||||
public interface StringStatistic extends Statistic {
|
||||
/**
|
||||
* Returns the String value of the statistic
|
||||
*/
|
||||
String getCurrent();
|
||||
}
|
||||
53
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/TimeStatistic.java
vendored
Normal file
53
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/TimeStatistic.java
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics;
|
||||
|
||||
/**
|
||||
* Specifies standard timing measurements.
|
||||
*/
|
||||
public interface TimeStatistic extends Statistic {
|
||||
/**
|
||||
* Number of times the operation was invoked since the beginning of this measurement.
|
||||
*/
|
||||
long getCount();
|
||||
|
||||
/**
|
||||
* The maximum amount of time taken to complete one invocation of this operation since the beginning of this measurement.
|
||||
*/
|
||||
long getMaxTime();
|
||||
|
||||
/**
|
||||
* The minimum amount of time taken to complete one invocation of this operation since the beginning of this measurement.
|
||||
*/
|
||||
long getMinTime();
|
||||
|
||||
/**
|
||||
* This is the sum total of time taken to complete every invocation of this operation since the beginning of this measurement. Dividing totalTime by count will give you the average execution time for this operation.
|
||||
*/
|
||||
long getTotalTime();
|
||||
}
|
||||
44
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/annotations/Reset.java
vendored
Normal file
44
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/annotations/Reset.java
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics.annotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jennifer Chou
|
||||
* Date: Sep 16, 2009
|
||||
*/
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.METHOD})
|
||||
public @interface Reset {
|
||||
}
|
||||
155
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/AverageRangeStatisticImpl.java
vendored
Normal file
155
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/AverageRangeStatisticImpl.java
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics.impl;
|
||||
|
||||
import java.util.Map;
|
||||
import java.lang.reflect.*;
|
||||
import com.sun.org.glassfish.external.statistics.AverageRangeStatistic;
|
||||
|
||||
/**
|
||||
* An implementation of AverageRangeStatistic that provides ways to change the
|
||||
* state externally through mutators. Convenience class that is useful for
|
||||
* components that gather the statistical data.
|
||||
* By merely changing the count (which is a mandatory measurement), rest of the statistical
|
||||
* information could be deduced.
|
||||
*/
|
||||
|
||||
public final class AverageRangeStatisticImpl extends StatisticImpl implements
|
||||
AverageRangeStatistic, InvocationHandler {
|
||||
|
||||
private long currentVal = 0L;
|
||||
private long highWaterMark = Long.MIN_VALUE;
|
||||
private long lowWaterMark = Long.MAX_VALUE;
|
||||
private long numberOfSamples = 0L;
|
||||
private long runningTotal = 0L;
|
||||
|
||||
private final long initCurrentVal;
|
||||
private final long initHighWaterMark;
|
||||
private final long initLowWaterMark;
|
||||
private final long initNumberOfSamples;
|
||||
private final long initRunningTotal;
|
||||
|
||||
private final AverageRangeStatistic as =
|
||||
(AverageRangeStatistic) Proxy.newProxyInstance(
|
||||
AverageRangeStatistic.class.getClassLoader(),
|
||||
new Class[] { AverageRangeStatistic.class },
|
||||
this);
|
||||
|
||||
public AverageRangeStatisticImpl(long curVal, long highMark, long lowMark,
|
||||
String name, String unit, String desc,
|
||||
long startTime, long sampleTime) {
|
||||
super(name, unit, desc, startTime, sampleTime);
|
||||
currentVal = curVal;
|
||||
initCurrentVal = curVal;
|
||||
highWaterMark = highMark;
|
||||
initHighWaterMark = highMark;
|
||||
lowWaterMark = lowMark;
|
||||
initLowWaterMark = lowMark;
|
||||
numberOfSamples = 0L;
|
||||
initNumberOfSamples = numberOfSamples;
|
||||
runningTotal = 0L;
|
||||
initRunningTotal = runningTotal;
|
||||
}
|
||||
|
||||
public synchronized AverageRangeStatistic getStatistic() {
|
||||
return as;
|
||||
}
|
||||
|
||||
public synchronized String toString() {
|
||||
return super.toString() + NEWLINE +
|
||||
"Current: " + getCurrent() + NEWLINE +
|
||||
"LowWaterMark: " + getLowWaterMark() + NEWLINE +
|
||||
"HighWaterMark: " + getHighWaterMark() + NEWLINE +
|
||||
"Average:" + getAverage();
|
||||
}
|
||||
|
||||
public synchronized Map getStaticAsMap() {
|
||||
Map m = super.getStaticAsMap();
|
||||
m.put("current", getCurrent());
|
||||
m.put("lowwatermark", getLowWaterMark());
|
||||
m.put("highwatermark", getHighWaterMark());
|
||||
m.put("average", getAverage());
|
||||
return m;
|
||||
}
|
||||
|
||||
public synchronized void reset() {
|
||||
super.reset();
|
||||
currentVal = initCurrentVal;
|
||||
highWaterMark = initHighWaterMark;
|
||||
lowWaterMark = initLowWaterMark;
|
||||
numberOfSamples = initNumberOfSamples;
|
||||
runningTotal = initRunningTotal;
|
||||
sampleTime = -1L;
|
||||
}
|
||||
|
||||
public synchronized long getAverage() {
|
||||
if(numberOfSamples == 0) {
|
||||
return -1;
|
||||
} else {
|
||||
return runningTotal / numberOfSamples;
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized long getCurrent() {
|
||||
return currentVal;
|
||||
}
|
||||
|
||||
public synchronized void setCurrent(long curVal) {
|
||||
currentVal = curVal;
|
||||
lowWaterMark = (curVal >= lowWaterMark ? lowWaterMark : curVal);
|
||||
highWaterMark = (curVal >= highWaterMark ? curVal : highWaterMark);
|
||||
numberOfSamples++;
|
||||
runningTotal += curVal;
|
||||
sampleTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public synchronized long getHighWaterMark() {
|
||||
return highWaterMark;
|
||||
}
|
||||
|
||||
public synchronized long getLowWaterMark() {
|
||||
return lowWaterMark;
|
||||
}
|
||||
|
||||
// todo: equals implementation
|
||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
||||
checkMethod(method);
|
||||
|
||||
Object result;
|
||||
try {
|
||||
result = method.invoke(this, args);
|
||||
} catch (InvocationTargetException e) {
|
||||
throw e.getTargetException();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("unexpected invocation exception: " +
|
||||
e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
96
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/BoundaryStatisticImpl.java
vendored
Normal file
96
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/BoundaryStatisticImpl.java
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics.impl;
|
||||
import com.sun.org.glassfish.external.statistics.BoundaryStatistic;
|
||||
import java.util.Map;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
/**
|
||||
* @author Sreenivas Munnangi
|
||||
*/
|
||||
public final class BoundaryStatisticImpl extends StatisticImpl
|
||||
implements BoundaryStatistic, InvocationHandler {
|
||||
|
||||
private final long lowerBound;
|
||||
private final long upperBound;
|
||||
|
||||
private final BoundaryStatistic bs =
|
||||
(BoundaryStatistic) Proxy.newProxyInstance(
|
||||
BoundaryStatistic.class.getClassLoader(),
|
||||
new Class[] { BoundaryStatistic.class },
|
||||
this);
|
||||
|
||||
public BoundaryStatisticImpl(long lower, long upper, String name,
|
||||
String unit, String desc, long startTime,
|
||||
long sampleTime) {
|
||||
super(name, unit, desc, startTime, sampleTime);
|
||||
upperBound = upper;
|
||||
lowerBound = lower;
|
||||
}
|
||||
|
||||
public synchronized BoundaryStatistic getStatistic() {
|
||||
return bs;
|
||||
}
|
||||
|
||||
public synchronized Map getStaticAsMap() {
|
||||
Map m = super.getStaticAsMap();
|
||||
m.put("lowerbound", getLowerBound());
|
||||
m.put("upperbound", getUpperBound());
|
||||
return m;
|
||||
}
|
||||
|
||||
public synchronized long getLowerBound() {
|
||||
return lowerBound;
|
||||
}
|
||||
|
||||
public synchronized long getUpperBound() {
|
||||
return upperBound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void reset() {
|
||||
super.reset();
|
||||
sampleTime = -1L;
|
||||
}
|
||||
|
||||
// todo: equals implementation
|
||||
public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
|
||||
checkMethod(m);
|
||||
|
||||
Object result;
|
||||
try {
|
||||
result = m.invoke(this, args);
|
||||
} catch (InvocationTargetException e) {
|
||||
throw e.getTargetException();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("unexpected invocation exception: " +
|
||||
e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
161
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/BoundedRangeStatisticImpl.java
vendored
Normal file
161
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/BoundedRangeStatisticImpl.java
vendored
Normal file
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics.impl;
|
||||
|
||||
import com.sun.org.glassfish.external.statistics.BoundedRangeStatistic;
|
||||
import java.util.Map;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
|
||||
/**
|
||||
* @author Sreenivas Munnangi
|
||||
*/
|
||||
public final class BoundedRangeStatisticImpl extends StatisticImpl
|
||||
implements BoundedRangeStatistic, InvocationHandler {
|
||||
|
||||
private long lowerBound = 0L;
|
||||
private long upperBound = 0L;
|
||||
private long currentVal = 0L;
|
||||
private long highWaterMark = Long.MIN_VALUE;
|
||||
private long lowWaterMark = Long.MAX_VALUE;
|
||||
|
||||
private final long initLowerBound;
|
||||
private final long initUpperBound;
|
||||
private final long initCurrentVal;
|
||||
private final long initHighWaterMark;
|
||||
private final long initLowWaterMark;
|
||||
|
||||
private final BoundedRangeStatistic bs =
|
||||
(BoundedRangeStatistic) Proxy.newProxyInstance(
|
||||
BoundedRangeStatistic.class.getClassLoader(),
|
||||
new Class[] { BoundedRangeStatistic.class },
|
||||
this);
|
||||
|
||||
public synchronized String toString() {
|
||||
return super.toString() + NEWLINE +
|
||||
"Current: " + getCurrent() + NEWLINE +
|
||||
"LowWaterMark: " + getLowWaterMark() + NEWLINE +
|
||||
"HighWaterMark: " + getHighWaterMark() + NEWLINE +
|
||||
"LowerBound: " + getLowerBound() + NEWLINE +
|
||||
"UpperBound: " + getUpperBound();
|
||||
}
|
||||
|
||||
|
||||
public BoundedRangeStatisticImpl(long curVal, long highMark, long lowMark,
|
||||
long upper, long lower, String name,
|
||||
String unit, String desc, long startTime,
|
||||
long sampleTime) {
|
||||
super(name, unit, desc, startTime, sampleTime);
|
||||
currentVal = curVal;
|
||||
initCurrentVal = curVal;
|
||||
highWaterMark = highMark;
|
||||
initHighWaterMark = highMark;
|
||||
lowWaterMark = lowMark;
|
||||
initLowWaterMark = lowMark;
|
||||
upperBound = upper;
|
||||
initUpperBound = upper;
|
||||
lowerBound = lower;
|
||||
initLowerBound = lower;
|
||||
}
|
||||
|
||||
public synchronized BoundedRangeStatistic getStatistic() {
|
||||
return bs;
|
||||
}
|
||||
|
||||
public synchronized Map getStaticAsMap() {
|
||||
Map m = super.getStaticAsMap();
|
||||
m.put("current", getCurrent());
|
||||
m.put("lowerbound", getLowerBound());
|
||||
m.put("upperbound", getUpperBound());
|
||||
m.put("lowwatermark", getLowWaterMark());
|
||||
m.put("highwatermark", getHighWaterMark());
|
||||
return m;
|
||||
}
|
||||
|
||||
public synchronized long getCurrent() {
|
||||
return currentVal;
|
||||
}
|
||||
|
||||
public synchronized void setCurrent(long curVal) {
|
||||
currentVal = curVal;
|
||||
lowWaterMark = (curVal >= lowWaterMark ? lowWaterMark : curVal);
|
||||
highWaterMark = (curVal >= highWaterMark ? curVal : highWaterMark);
|
||||
sampleTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public synchronized long getHighWaterMark() {
|
||||
return highWaterMark;
|
||||
}
|
||||
|
||||
public synchronized void setHighWaterMark(long hwm) {
|
||||
highWaterMark = hwm;
|
||||
}
|
||||
|
||||
public synchronized long getLowWaterMark() {
|
||||
return lowWaterMark;
|
||||
}
|
||||
|
||||
public synchronized void setLowWaterMark(long lwm) {
|
||||
lowWaterMark = lwm;
|
||||
}
|
||||
|
||||
public synchronized long getLowerBound() {
|
||||
return lowerBound;
|
||||
}
|
||||
|
||||
public synchronized long getUpperBound() {
|
||||
return upperBound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void reset() {
|
||||
super.reset();
|
||||
lowerBound = initLowerBound;
|
||||
upperBound = initUpperBound;
|
||||
currentVal = initCurrentVal;
|
||||
highWaterMark = initHighWaterMark;
|
||||
lowWaterMark = initLowWaterMark;
|
||||
sampleTime = -1L;
|
||||
}
|
||||
|
||||
// todo: equals implementation
|
||||
public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
|
||||
checkMethod(m);
|
||||
|
||||
Object result;
|
||||
try {
|
||||
result = m.invoke(this, args);
|
||||
} catch (InvocationTargetException e) {
|
||||
throw e.getTargetException();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("unexpected invocation exception: " +
|
||||
e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
118
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/CountStatisticImpl.java
vendored
Normal file
118
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/CountStatisticImpl.java
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics.impl;
|
||||
import com.sun.org.glassfish.external.statistics.CountStatistic;
|
||||
import java.util.Map;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
/**
|
||||
* @author Sreenivas Munnangi
|
||||
*/
|
||||
public final class CountStatisticImpl extends StatisticImpl
|
||||
implements CountStatistic, InvocationHandler {
|
||||
|
||||
private long count = 0L;
|
||||
private final long initCount;
|
||||
|
||||
private final CountStatistic cs =
|
||||
(CountStatistic) Proxy.newProxyInstance(
|
||||
CountStatistic.class.getClassLoader(),
|
||||
new Class[] { CountStatistic.class },
|
||||
this);
|
||||
|
||||
public CountStatisticImpl(long countVal, String name, String unit,
|
||||
String desc, long sampleTime, long startTime) {
|
||||
super(name, unit, desc, startTime, sampleTime);
|
||||
count = countVal;
|
||||
initCount = countVal;
|
||||
}
|
||||
|
||||
public CountStatisticImpl(String name, String unit, String desc) {
|
||||
this(0L, name, unit, desc, -1L, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public synchronized CountStatistic getStatistic() {
|
||||
return cs;
|
||||
}
|
||||
|
||||
public synchronized Map getStaticAsMap() {
|
||||
Map m = super.getStaticAsMap();
|
||||
m.put("count", getCount());
|
||||
return m;
|
||||
}
|
||||
|
||||
public synchronized String toString() {
|
||||
return super.toString() + NEWLINE + "Count: " + getCount();
|
||||
}
|
||||
|
||||
public synchronized long getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public synchronized void setCount(long countVal) {
|
||||
count = countVal;
|
||||
sampleTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public synchronized void increment() {
|
||||
count++;
|
||||
sampleTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public synchronized void increment(long delta) {
|
||||
count = count + delta;
|
||||
sampleTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public synchronized void decrement() {
|
||||
count--;
|
||||
sampleTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void reset() {
|
||||
super.reset();
|
||||
count = initCount;
|
||||
sampleTime = -1L;
|
||||
}
|
||||
|
||||
// todo: equals implementation
|
||||
public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
|
||||
checkMethod(m);
|
||||
|
||||
Object result;
|
||||
try {
|
||||
result = m.invoke(this, args);
|
||||
} catch (InvocationTargetException e) {
|
||||
throw e.getTargetException();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("unexpected invocation exception: " +
|
||||
e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
140
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/RangeStatisticImpl.java
vendored
Normal file
140
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/RangeStatisticImpl.java
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics.impl;
|
||||
import com.sun.org.glassfish.external.statistics.RangeStatistic;
|
||||
import java.util.Map;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
/**
|
||||
* @author Sreenivas Munnangi
|
||||
*/
|
||||
public final class RangeStatisticImpl extends StatisticImpl
|
||||
implements RangeStatistic, InvocationHandler {
|
||||
|
||||
private long currentVal = 0L;
|
||||
private long highWaterMark = Long.MIN_VALUE;
|
||||
private long lowWaterMark = Long.MAX_VALUE;
|
||||
private final long initCurrentVal;
|
||||
private final long initHighWaterMark;
|
||||
private final long initLowWaterMark;
|
||||
|
||||
private final RangeStatistic rs =
|
||||
(RangeStatistic) Proxy.newProxyInstance(
|
||||
RangeStatistic.class.getClassLoader(),
|
||||
new Class[] { RangeStatistic.class },
|
||||
this);
|
||||
|
||||
public RangeStatisticImpl(long curVal, long highMark, long lowMark,
|
||||
String name, String unit, String desc,
|
||||
long startTime, long sampleTime) {
|
||||
super(name, unit, desc, startTime, sampleTime);
|
||||
currentVal = curVal;
|
||||
initCurrentVal = curVal;
|
||||
highWaterMark = highMark;
|
||||
initHighWaterMark = highMark;
|
||||
lowWaterMark = lowMark;
|
||||
initLowWaterMark = lowMark;
|
||||
}
|
||||
|
||||
public synchronized RangeStatistic getStatistic() {
|
||||
return rs;
|
||||
}
|
||||
|
||||
public synchronized Map getStaticAsMap() {
|
||||
Map m = super.getStaticAsMap();
|
||||
m.put("current", getCurrent());
|
||||
m.put("lowwatermark", getLowWaterMark());
|
||||
m.put("highwatermark", getHighWaterMark());
|
||||
return m;
|
||||
}
|
||||
|
||||
public synchronized long getCurrent() {
|
||||
return currentVal;
|
||||
}
|
||||
|
||||
public synchronized void setCurrent(long curVal) {
|
||||
currentVal = curVal;
|
||||
lowWaterMark = (curVal >= lowWaterMark ? lowWaterMark : curVal);
|
||||
highWaterMark = (curVal >= highWaterMark ? curVal : highWaterMark);
|
||||
sampleTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the highest value of this statistic, since measurement started.
|
||||
*/
|
||||
public synchronized long getHighWaterMark() {
|
||||
return highWaterMark;
|
||||
}
|
||||
|
||||
public synchronized void setHighWaterMark(long hwm) {
|
||||
highWaterMark = hwm;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the lowest value of this statistic, since measurement started.
|
||||
*/
|
||||
public synchronized long getLowWaterMark() {
|
||||
return lowWaterMark;
|
||||
}
|
||||
|
||||
public synchronized void setLowWaterMark(long lwm) {
|
||||
lowWaterMark = lwm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void reset() {
|
||||
super.reset();
|
||||
currentVal = initCurrentVal;
|
||||
highWaterMark = initHighWaterMark;
|
||||
lowWaterMark = initLowWaterMark;
|
||||
sampleTime = -1L;
|
||||
}
|
||||
|
||||
public synchronized String toString() {
|
||||
return super.toString() + NEWLINE +
|
||||
"Current: " + getCurrent() + NEWLINE +
|
||||
"LowWaterMark: " + getLowWaterMark() + NEWLINE +
|
||||
"HighWaterMark: " + getHighWaterMark();
|
||||
}
|
||||
|
||||
// todo: equals implementation
|
||||
public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
|
||||
checkMethod(m);
|
||||
|
||||
Object result;
|
||||
try {
|
||||
result = m.invoke(this, args);
|
||||
} catch (InvocationTargetException e) {
|
||||
throw e.getTargetException();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("unexpected invocation exception: " +
|
||||
e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
145
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/StatisticImpl.java
vendored
Normal file
145
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/StatisticImpl.java
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics.impl;
|
||||
import com.sun.org.glassfish.external.statistics.Statistic;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* @author Sreenivas Munnangi
|
||||
*/
|
||||
public abstract class StatisticImpl implements Statistic {
|
||||
|
||||
private final String statisticName;
|
||||
private final String statisticUnit;
|
||||
private final String statisticDesc;
|
||||
protected long sampleTime = -1L;
|
||||
private long startTime;
|
||||
public static final String UNIT_COUNT = "count";
|
||||
public static final String UNIT_SECOND = "second";
|
||||
public static final String UNIT_MILLISECOND = "millisecond";
|
||||
public static final String UNIT_MICROSECOND = "microsecond";
|
||||
public static final String UNIT_NANOSECOND = "nanosecond";
|
||||
public static final String START_TIME = "starttime";
|
||||
public static final String LAST_SAMPLE_TIME = "lastsampletime";
|
||||
|
||||
protected final Map<String, Object> statMap = new ConcurrentHashMap<String, Object> ();
|
||||
|
||||
protected static final String NEWLINE = System.getProperty( "line.separator" );
|
||||
|
||||
protected StatisticImpl(String name, String unit, String desc,
|
||||
long start_time, long sample_time) {
|
||||
|
||||
if (isValidString(name)) {
|
||||
statisticName = name;
|
||||
} else {
|
||||
statisticName = "name";
|
||||
}
|
||||
|
||||
if (isValidString(unit)) {
|
||||
statisticUnit = unit;
|
||||
} else {
|
||||
statisticUnit = "unit";
|
||||
}
|
||||
|
||||
if (isValidString(desc)) {
|
||||
statisticDesc = desc;
|
||||
} else {
|
||||
statisticDesc = "description";
|
||||
}
|
||||
|
||||
startTime = start_time;
|
||||
sampleTime = sample_time;
|
||||
}
|
||||
|
||||
protected StatisticImpl(String name, String unit, String desc) {
|
||||
this(name, unit, desc, System.currentTimeMillis(), System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public synchronized Map getStaticAsMap() {
|
||||
if (isValidString(statisticName)) {
|
||||
statMap.put("name", statisticName);
|
||||
}
|
||||
if (isValidString(statisticUnit)) {
|
||||
statMap.put("unit", statisticUnit);
|
||||
}
|
||||
if (isValidString(statisticDesc)) {
|
||||
statMap.put("description", statisticDesc);
|
||||
}
|
||||
statMap.put(StatisticImpl.START_TIME, startTime);
|
||||
statMap.put(StatisticImpl.LAST_SAMPLE_TIME, sampleTime);
|
||||
return statMap;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.statisticName;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.statisticDesc;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return this.statisticUnit;
|
||||
}
|
||||
|
||||
public synchronized long getLastSampleTime() {
|
||||
return sampleTime;
|
||||
}
|
||||
|
||||
public synchronized long getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public synchronized void reset() {
|
||||
startTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public synchronized String toString() {
|
||||
return "Statistic " + getClass().getName() + NEWLINE +
|
||||
"Name: " + getName() + NEWLINE +
|
||||
"Description: " + getDescription() + NEWLINE +
|
||||
"Unit: " + getUnit() + NEWLINE +
|
||||
"LastSampleTime: " + getLastSampleTime() + NEWLINE +
|
||||
"StartTime: " + getStartTime();
|
||||
}
|
||||
|
||||
protected static boolean isValidString(String str) {
|
||||
return (str!=null && str.length()>0);
|
||||
}
|
||||
|
||||
protected void checkMethod(Method method) {
|
||||
if (method == null || method.getDeclaringClass() == null
|
||||
|| !Statistic.class.isAssignableFrom(method.getDeclaringClass())
|
||||
|| Modifier.isStatic(method.getModifiers())) {
|
||||
throw new RuntimeException("Invalid method on invoke");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
79
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/StatsImpl.java
vendored
Normal file
79
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/StatsImpl.java
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics.impl;
|
||||
import com.sun.org.glassfish.external.statistics.Stats;
|
||||
import com.sun.org.glassfish.external.statistics.Statistic;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author Jennifer Chou
|
||||
*/
|
||||
public final class StatsImpl implements Stats {
|
||||
|
||||
private final StatisticImpl[] statArray;
|
||||
|
||||
protected StatsImpl(StatisticImpl[] statisticArray) {
|
||||
statArray = statisticArray;
|
||||
}
|
||||
|
||||
public synchronized Statistic getStatistic(String statisticName) {
|
||||
Statistic stat = null;
|
||||
for (Statistic s : statArray) {
|
||||
if (s.getName().equals(statisticName)) {
|
||||
stat = s;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return stat;
|
||||
}
|
||||
|
||||
public synchronized String[] getStatisticNames() {
|
||||
ArrayList list = new ArrayList();
|
||||
for (Statistic s : statArray) {
|
||||
list.add(s.getName());
|
||||
}
|
||||
String[] strArray = new String[list.size()];
|
||||
return (String[])list.toArray(strArray);
|
||||
}
|
||||
|
||||
public synchronized Statistic[] getStatistics() {
|
||||
return this.statArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call reset on all of the Statistic objects contained by this Stats object
|
||||
*/
|
||||
public synchronized void reset() {
|
||||
for (StatisticImpl s : statArray) {
|
||||
s.reset();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
106
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/StringStatisticImpl.java
vendored
Normal file
106
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/StringStatisticImpl.java
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics.impl;
|
||||
import com.sun.org.glassfish.external.statistics.StringStatistic;
|
||||
import java.util.Map;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
/**
|
||||
* @author Sreenivas Munnangi
|
||||
*/
|
||||
public final class StringStatisticImpl extends StatisticImpl
|
||||
implements StringStatistic, InvocationHandler {
|
||||
|
||||
private volatile String str = null;
|
||||
private final String initStr;
|
||||
|
||||
private final StringStatistic ss =
|
||||
(StringStatistic) Proxy.newProxyInstance(
|
||||
StringStatistic.class.getClassLoader(),
|
||||
new Class[] { StringStatistic.class },
|
||||
this);
|
||||
|
||||
public StringStatisticImpl(String str, String name, String unit,
|
||||
String desc, long sampleTime, long startTime) {
|
||||
super(name, unit, desc, startTime, sampleTime);
|
||||
this.str = str;
|
||||
initStr = str;
|
||||
}
|
||||
|
||||
public StringStatisticImpl(String name, String unit, String desc) {
|
||||
this("", name, unit, desc, System.currentTimeMillis(), System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public synchronized StringStatistic getStatistic() {
|
||||
return ss;
|
||||
}
|
||||
|
||||
public synchronized Map getStaticAsMap() {
|
||||
Map m = super.getStaticAsMap();
|
||||
if (getCurrent() != null) {
|
||||
m.put("current", getCurrent());
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
public synchronized String toString() {
|
||||
return super.toString() + NEWLINE + "Current-value: " + getCurrent();
|
||||
}
|
||||
|
||||
public String getCurrent() {
|
||||
return str;
|
||||
}
|
||||
|
||||
public void setCurrent(String str) {
|
||||
this.str = str;
|
||||
sampleTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void reset() {
|
||||
super.reset();
|
||||
this.str = initStr;
|
||||
sampleTime = -1L;
|
||||
}
|
||||
|
||||
// todo: equals implementation
|
||||
public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
|
||||
checkMethod(m);
|
||||
|
||||
Object result;
|
||||
try {
|
||||
result = m.invoke(this, args);
|
||||
} catch (InvocationTargetException e) {
|
||||
throw e.getTargetException();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("unexpected invocation exception: " +
|
||||
e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
160
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/TimeStatisticImpl.java
vendored
Normal file
160
jdkSrc/jdk8/com/sun/org/glassfish/external/statistics/impl/TimeStatisticImpl.java
vendored
Normal file
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package com.sun.org.glassfish.external.statistics.impl;
|
||||
|
||||
import com.sun.org.glassfish.external.statistics.TimeStatistic;
|
||||
import java.util.Map;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
/**
|
||||
* @author Sreenivas Munnangi
|
||||
*/
|
||||
public final class TimeStatisticImpl extends StatisticImpl
|
||||
implements TimeStatistic, InvocationHandler {
|
||||
|
||||
private long count = 0L;
|
||||
private long maxTime = 0L;
|
||||
private long minTime = 0L;
|
||||
private long totTime = 0L;
|
||||
private final long initCount;
|
||||
private final long initMaxTime;
|
||||
private final long initMinTime;
|
||||
private final long initTotTime;
|
||||
|
||||
private final TimeStatistic ts =
|
||||
(TimeStatistic) Proxy.newProxyInstance(
|
||||
TimeStatistic.class.getClassLoader(),
|
||||
new Class[] { TimeStatistic.class },
|
||||
this);
|
||||
|
||||
public synchronized final String toString() {
|
||||
return super.toString() + NEWLINE +
|
||||
"Count: " + getCount() + NEWLINE +
|
||||
"MinTime: " + getMinTime() + NEWLINE +
|
||||
"MaxTime: " + getMaxTime() + NEWLINE +
|
||||
"TotalTime: " + getTotalTime();
|
||||
}
|
||||
|
||||
public TimeStatisticImpl(long counter, long maximumTime, long minimumTime,
|
||||
long totalTime, String name, String unit,
|
||||
String desc, long startTime, long sampleTime) {
|
||||
super(name, unit, desc, startTime, sampleTime);
|
||||
count = counter;
|
||||
initCount = counter;
|
||||
maxTime = maximumTime;
|
||||
initMaxTime = maximumTime;
|
||||
minTime = minimumTime;
|
||||
initMinTime = minimumTime;
|
||||
totTime = totalTime;
|
||||
initTotTime = totalTime;
|
||||
}
|
||||
|
||||
public synchronized TimeStatistic getStatistic() {
|
||||
return ts;
|
||||
}
|
||||
|
||||
public synchronized Map getStaticAsMap() {
|
||||
Map m = super.getStaticAsMap();
|
||||
m.put("count", getCount());
|
||||
m.put("maxtime", getMaxTime());
|
||||
m.put("mintime", getMinTime());
|
||||
m.put("totaltime", getTotalTime());
|
||||
return m;
|
||||
}
|
||||
|
||||
public synchronized void incrementCount(long current) {
|
||||
if (count == 0) {
|
||||
totTime = current;
|
||||
maxTime = current;
|
||||
minTime = current;
|
||||
} else {
|
||||
totTime = totTime + current;
|
||||
maxTime = (current >= maxTime ? current : maxTime);
|
||||
minTime = (current >= minTime ? minTime : current);
|
||||
}
|
||||
count++;
|
||||
sampleTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of times an operation was invoked
|
||||
*/
|
||||
public synchronized long getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum amount of time that it took for one invocation of an
|
||||
* operation, since measurement started.
|
||||
*/
|
||||
public synchronized long getMaxTime() {
|
||||
return maxTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minimum amount of time that it took for one invocation of an
|
||||
* operation, since measurement started.
|
||||
*/
|
||||
public synchronized long getMinTime() {
|
||||
return minTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the amount of time that it took for all invocations,
|
||||
* since measurement started.
|
||||
*/
|
||||
public synchronized long getTotalTime() {
|
||||
return totTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void reset() {
|
||||
super.reset();
|
||||
count = initCount;
|
||||
maxTime = initMaxTime;
|
||||
minTime = initMinTime;
|
||||
totTime = initTotTime;
|
||||
sampleTime = -1L;
|
||||
}
|
||||
|
||||
// todo: equals implementation
|
||||
public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
|
||||
checkMethod(m);
|
||||
|
||||
Object result;
|
||||
try {
|
||||
result = m.invoke(this, args);
|
||||
} catch (InvocationTargetException e) {
|
||||
throw e.getTargetException();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("unexpected invocation exception: " +
|
||||
e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user