[java-support] branch dev/JSPT-111 updated: Collapse metric prefix and name for simplicity.

Scott Cantor cantor.2 at osu.edu
Thu Jun 16 15:26:58 UTC 2022


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch dev/JSPT-111
in repository java-support.

View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=85fa9eea46bf52cfe8a7d943ad23c446cc602ef6

The following commit(s) were added to refs/heads/dev/JSPT-111 by this push:
     new 85fa9ee  Collapse metric prefix and name for simplicity.
85fa9ee is described below

commit 85fa9eea46bf52cfe8a7d943ad23c446cc602ef6
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Jun 16 11:26:55 2022 -0400

    Collapse metric prefix and name for simplicity.
---
 .../support/service/ReloadableServiceGaugeSet.java | 34 ++--------------------
 1 file changed, 3 insertions(+), 31 deletions(-)

diff --git a/src/main/java/net/shibboleth/utilities/java/support/service/ReloadableServiceGaugeSet.java b/src/main/java/net/shibboleth/utilities/java/support/service/ReloadableServiceGaugeSet.java
index 62030eb..7907262 100644
--- a/src/main/java/net/shibboleth/utilities/java/support/service/ReloadableServiceGaugeSet.java
+++ b/src/main/java/net/shibboleth/utilities/java/support/service/ReloadableServiceGaugeSet.java
@@ -31,7 +31,6 @@ import net.shibboleth.utilities.java.support.component.AbstractInitializableComp
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
 import net.shibboleth.utilities.java.support.logic.Constraint;
-import net.shibboleth.utilities.java.support.primitive.StringSupport;
 
 import java.time.Instant;
 import java.util.Collections;
@@ -46,9 +45,6 @@ import javax.annotation.Nonnull;
  */
 public class ReloadableServiceGaugeSet<T> extends AbstractInitializableComponent implements MetricSet, MetricFilter {
 
-    /** Default prefix for metrics. */
-    @Nonnull @NotEmpty protected static final String DEFAULT_METRIC_NAME = "net.shibboleth.idp";
-
     /** The map of gauges. */
     @NonnullAfterInit @NonnullElements private Map<String,Metric> gauges;
     
@@ -58,9 +54,6 @@ public class ReloadableServiceGaugeSet<T> extends AbstractInitializableComponent
     /** The metric Prefix. */
     @Nonnull @NotEmpty private final String metricPrefix;
 
-    /** The default metric name. */
-    @Nonnull @NotEmpty private String defaultMetricName;
-
     /**
      * Constructor.
      * 
@@ -69,27 +62,6 @@ public class ReloadableServiceGaugeSet<T> extends AbstractInitializableComponent
     public ReloadableServiceGaugeSet(@Nonnull @NotEmpty @ParameterName(name="metricName") final String metricName) {
         metricPrefix = Constraint.isNotEmpty(metricName, "Metric name cannot be null or empty");
     }
-
-    /**
-     * Get the default metric name.
-     * 
-     * @return default metric name
-     */
-    @NonnullAfterInit @NotEmpty public String getDefaultMetricName() {
-        return defaultMetricName;
-    }
-    
-    /**
-     * Set the default metric name.
-     * 
-     * @param name the name
-     */
-    public void setDefaultMetricName(@Nonnull @NotEmpty final String name) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        
-        defaultMetricName = Constraint.isNotNull(StringSupport.trimOrNull(name),
-                "Default metric name cannot be null or empty");
-    }
     
     /**
      * Get the service to report on.
@@ -121,7 +93,7 @@ public class ReloadableServiceGaugeSet<T> extends AbstractInitializableComponent
         gauges = new HashMap<>();
 
         gauges.put(
-                MetricRegistry.name(defaultMetricName, metricPrefix, "reload", "success"),
+                MetricRegistry.name(metricPrefix, "reload", "success"),
                 new Gauge<Instant>() {
                     public Instant getValue() {
                         return service.getLastSuccessfulReloadInstant();
@@ -129,7 +101,7 @@ public class ReloadableServiceGaugeSet<T> extends AbstractInitializableComponent
                 });
         
         gauges.put(
-                MetricRegistry.name(defaultMetricName, metricPrefix, "reload", "attempt"),
+                MetricRegistry.name(metricPrefix, "reload", "attempt"),
                 new Gauge<Instant>() {
                     public Instant getValue() {
                         return service.getLastReloadAttemptInstant();
@@ -137,7 +109,7 @@ public class ReloadableServiceGaugeSet<T> extends AbstractInitializableComponent
                 });
 
         gauges.put(
-                MetricRegistry.name(defaultMetricName, metricPrefix, "reload", "error"),
+                MetricRegistry.name(metricPrefix, "reload", "error"),
                 new Gauge<String>() {
                     public String getValue() {
                         return service.getReloadFailureCause() != null

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list