Creating 2 FiberScheduler with MonitorType.METRICS cause "A metric named runawayFibers already exists"
bckfnn opened this issue · 0 comments
bckfnn commented
with code like:
public static void main(String[] args) {
FiberScheduler s1 = new FiberForkJoinScheduler("s1", 4, MonitorType.METRICS, true);
FiberScheduler s2 = new FiberForkJoinScheduler("s2", 4, MonitorType.METRICS, true);
}
I get an exception
Exception in thread "main" java.lang.IllegalArgumentException: A metric named runawayFibers already exists
at com.codahale.metrics.MetricRegistry.register(MetricRegistry.java:91)
at co.paralleluniverse.common.monitoring.Metrics.register(Metrics.java:42)
at co.paralleluniverse.fibers.MetricsFibersMonitor.<init>(MetricsFibersMonitor.java:56)
at co.paralleluniverse.fibers.FiberScheduler.createFibersMonitor(FiberScheduler.java:50)
at co.paralleluniverse.fibers.FiberScheduler.<init>(FiberScheduler.java:40)
at co.paralleluniverse.fibers.FiberForkJoinScheduler.<init>(FiberForkJoinScheduler.java:59)
at co.paralleluniverse.fibers.FiberForkJoinScheduler.<init>(FiberForkJoinScheduler.java:73)
at test.FiberTest.main(FiberTest.java:12)
It looks like the runawayFibers metrics is not prefixed with the name of the scheduler like the rest of the metrics.