private static final Logger LOGGER = LoggerFactory.getLogger(Development.class);
public static TreeMap<String,Integer> histogram = new TreeMap<>();
+ public static Map<String, Exception> histogramExceptions = new HashMap<>();
public static final boolean DEVELOPMENT = false;
-
+ private static final int histogramExceptionThreshold = 100;
+
public static final String PRINT = "Development.print";
public interface DevelopmentListener {
String key = o.toString();
Integer i = histogram.get(key);
histogram.put(key, i == null ? 1 : i+1);
+ if (i != null && i >= histogramExceptionThreshold) {
+ histogramExceptions.computeIfAbsent(key, k -> new Exception());
+ }
}
}