Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
Reviewed
Description
Passing a negative value to the interval field of MetricsRegistry#newQuantiles should throw a MetricsException with a clear error message. The current stack trace looks something like:
java.lang.IllegalArgumentException: null
at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleAtFixedRate(ScheduledThreadPoolExecutor.java:420)
at org.apache.hadoop.metrics2.lib.MutableQuantiles.<init>(MutableQuantiles.java:107)
at org.apache.hadoop.metrics2.lib.MetricsRegistry.newQuantiles(MetricsRegistry.java:200)
Along similar lines, should the other methods like MetricsRegistry#newCounter() also have parameter checking for negative int/long values?