Improve segmented journal JMX beans 38/81938/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 3 May 2019 11:01:14 +0000 (13:01 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 7 May 2019 10:48:15 +0000 (12:48 +0200)
This patch updates metric naming to properly tie them to individual
journals -- so that the statistics are actually useful.

JIRA: CONTROLLER-1884
Change-Id: I6f4f398894860566e234562d731462535b62801e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit bb366ba1be306e7678d81a116c1415876fa9fc75)

opendaylight/md-sal/sal-akka-segmented-journal/src/main/java/org/opendaylight/controller/akka/segjournal/SegmentedJournalActor.java

index c5fd3cf17189ce65d7245e2eb7ebb800e5e8d712..1739b25cab023c19f72be61675813977faf6e90a 100644 (file)
@@ -191,7 +191,7 @@ final class SegmentedJournalActor extends AbstractActor {
         super.preStart();
 
         final MetricRegistry registry = MetricsReporter.getInstance(MeteringBehavior.DOMAIN).getMetricsRegistry();
-        final String actorName = self().path().toStringWithoutAddress();
+        final String actorName = self().path().parent().toStringWithoutAddress() + '/' + directory.getName();
 
         batchWriteTime = registry.timer(MetricRegistry.name(actorName, "batchWriteTime"));
         messageWriteCount = registry.meter(MetricRegistry.name(actorName, "messageWriteCount"));