sarankk commented on code in PR #102:
URL: https://github.com/apache/cassandra-sidecar/pull/102#discussion_r1536132859
##########
src/main/java/org/apache/cassandra/sidecar/cluster/instance/InstanceMetadataImpl.java:
##########
@@ -188,6 +203,29 @@ public Builder delegate(CassandraAdapterDelegate delegate)
return update(b -> b.delegate = delegate);
}
+ /**
+ * Builds instance specific {@link
com.codahale.metrics.MetricRegistry} given the global registry name.
+ *
+ * @param registryName global {@link
com.codahale.metrics.MetricRegistry} name
+ * @return a reference to this Builder
+ */
+ public Builder globalMetricRegistryName(String registryName)
+
+ {
+ Objects.requireNonNull(registryName);
+
+ String instanceRegistryName = instanceRegistryName(registryName);
+ MetricRegistry instanceMetricRegistry =
SharedMetricRegistries.getOrCreate(instanceRegistryName);
+ InstanceMetricsImpl instanceMetrics = new
InstanceMetricsImpl(instanceMetricRegistry);
+
+ return update(b -> b.metrics = instanceMetrics);
+ }
+
+ private String instanceRegistryName(String globalRegistryName)
+ {
+ return globalRegistryName + "_" + id;
Review Comment:
Setting registry before building makes sense. Modified this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]