You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2022/11/11 06:09:02 UTC

[GitHub] [ratis] szetszwo commented on a diff in pull request #778: RATIS-1741 Add a removeReporterRegistration method

szetszwo commented on code in PR #778:
URL: https://github.com/apache/ratis/pull/778#discussion_r1019862352


##########
ratis-metrics-api/src/main/java/org/apache/ratis/metrics/MetricRegistries.java:
##########
@@ -93,10 +93,20 @@ public static MetricRegistries global() {
    * Add hook to register reporter for the metricRegistry.
    *
    * @param reporterRegistration Consumer to create the reporter for the registry.
+   * @param stopReporter Consumer to stop the reporter for the registry.
    */
   public abstract void addReporterRegistration(Consumer<RatisMetricRegistry> reporterRegistration,
       Consumer<RatisMetricRegistry> stopReporter);
 
+  /**
+   * Remove hook of reporter for the metricRegistry.
+   *
+   * @param reporterRegistration Consumer to create the reporter for the registry.
+   * @param stopReporter Consumer to stop the reporter for the registry.
+   */
+  public abstract void removeReporterRegistration(Consumer<RatisMetricRegistry> reporterRegistration,
+                                               Consumer<RatisMetricRegistry> stopReporter);

Review Comment:
   Let's add a default implementation for compatibility.
   ```java
     public void removeReporterRegistration(Consumer<RatisMetricRegistry> reporterRegistration,
         Consumer<RatisMetricRegistry> stopReporter) {
     }
   ```



-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org