pankaj

Move the starting of reporter to activate

...@@ -72,24 +72,23 @@ public final class MetricsManager implements MetricsService { ...@@ -72,24 +72,23 @@ public final class MetricsManager implements MetricsService {
72 private final CsvReporter reporter; 72 private final CsvReporter reporter;
73 73
74 public MetricsManager() { 74 public MetricsManager() {
75 - this.componentsRegistry = new ConcurrentHashMap<>();
76 this.metricsRegistry = new MetricRegistry(); 75 this.metricsRegistry = new MetricRegistry();
77 -
78 this.reporter = CsvReporter.forRegistry(metricsRegistry) 76 this.reporter = CsvReporter.forRegistry(metricsRegistry)
79 .formatFor(Locale.US) 77 .formatFor(Locale.US)
80 .convertRatesTo(TimeUnit.SECONDS) 78 .convertRatesTo(TimeUnit.SECONDS)
81 .convertDurationsTo(TimeUnit.MICROSECONDS) 79 .convertDurationsTo(TimeUnit.MICROSECONDS)
82 - .build(new File("/tmp/")); 80 + .build(new File("/var/onos/log/metrics/"));
83 -
84 - reporter.start(10, TimeUnit.SECONDS);
85 } 81 }
86 82
87 @Activate 83 @Activate
88 public void activate() { 84 public void activate() {
85 + this.componentsRegistry = new ConcurrentHashMap<>();
86 + reporter.start(10, TimeUnit.SECONDS);
89 } 87 }
90 88
91 @Deactivate 89 @Deactivate
92 public void deactivate() { 90 public void deactivate() {
91 + reporter.stop();
93 } 92 }
94 93
95 /** 94 /**
......