reschke commented on code in PR #125:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/125#discussion_r1819094907


##########
src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverMetrics.java:
##########
@@ -85,18 +87,27 @@ public class ResourceResolverMetrics {
     private ServiceRegistration<Gauge<Long>> 
numberOfResourcesWithAliasesOnStartupGauge;
     private Supplier<Long> numberOfResourcesWithAliasesOnStartupSupplier = 
ZERO_SUPPLIER;
 
-    private Counter unclosedResourceResolvers;
+    // total number of detected invalid aliases on startup
+    private ServiceRegistration<Gauge<Long>> 
numberOfDetectedInvalidAliasesGauge;
+    private Supplier<Long> numberOfDetectedInvalidAliasesSupplier = 
ZERO_SUPPLIER;
+
+    // total number of detected conflicting aliases on startup
+    private ServiceRegistration<Gauge<Long>> 
numberOfDetectedConflictingAliasesGauge;
+    private Supplier<Long> numberOfDetectedConflictingAliasesSupplier = 
ZERO_SUPPLIER;
 
+    private Counter unclosedResourceResolvers;
 
     @Activate
     protected void activate(BundleContext bundleContext) {
-        numberOfVanityPathsGauge = registerGauge(bundleContext, METRICS_PREFIX 
+ ".numberOfVanityPaths", () -> numberOfVanityPathsSupplier );
-        numberOfResourcesWithVanityPathsOnStartupGauge = 
registerGauge(bundleContext, METRICS_PREFIX + 
".numberOfResourcesWithVanityPathsOnStartup", () -> 
numberOfResourcesWithVanityPathsOnStartupSupplier );
-        numberOfVanityPathLookupsGauge = registerGauge(bundleContext, 
METRICS_PREFIX + ".numberOfVanityPathLookups", () -> 
numberOfVanityPathLookupsSupplier );
-        numberOfVanityPathBloomNegativeGauge = registerGauge(bundleContext, 
METRICS_PREFIX + ".numberOfVanityPathBloomNegatives", () -> 
numberOfVanityPathBloomNegativeSupplier );
-        numberOfVanityPathBloomFalsePositiveGauge = 
registerGauge(bundleContext, METRICS_PREFIX + 
".numberOfVanityPathBloomFalsePositives", () -> 
numberOfVanityPathBloomFalsePositiveSupplier );
+        numberOfVanityPathsGauge = registerGauge(bundleContext, METRICS_PREFIX 
+ ".numberOfVanityPaths", () -> numberOfVanityPathsSupplier);
+        numberOfResourcesWithVanityPathsOnStartupGauge = 
registerGauge(bundleContext, METRICS_PREFIX + 
".numberOfResourcesWithVanityPathsOnStartup", () -> 
numberOfResourcesWithVanityPathsOnStartupSupplier);
+        numberOfVanityPathLookupsGauge = registerGauge(bundleContext, 
METRICS_PREFIX + ".numberOfVanityPathLookups", () -> 
numberOfVanityPathLookupsSupplier);
+        numberOfVanityPathBloomNegativeGauge = registerGauge(bundleContext, 
METRICS_PREFIX + ".numberOfVanityPathBloomNegative", () -> 
numberOfVanityPathBloomNegativeSupplier);
+        numberOfVanityPathBloomFalsePositiveGauge = 
registerGauge(bundleContext, METRICS_PREFIX + 
".numberOfVanityPathBloomFalsePositive", () -> 
numberOfVanityPathBloomFalsePositiveSupplier);

Review Comment:
   There was an inconstency between metric names and method names (which I 
noticed when adding tests). It might be better to adjust the method names, I 
guess.



-- 
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]

Reply via email to