You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/07/21 19:03:59 UTC

[GitHub] [solr] justinrsweeney commented on a diff in pull request #948: SOLR-15007: Adding ability to provide aggregated node level metrics for request handlers

justinrsweeney commented on code in PR #948:
URL: https://github.com/apache/solr/pull/948#discussion_r927015744


##########
solr/core/src/java/org/apache/solr/metrics/DelegateRegistryCounter.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.metrics;
+
+import com.codahale.metrics.Counter;
+
+public class DelegateRegistryCounter extends Counter {
+
+  private final Counter primaryCounter;

Review Comment:
   The challenge that I found here is that when these are actually created here: https://github.com/justinrsweeney/solr/blob/5d17a4865c7c46f33fb6fc08b0d57b69937dfffe/solr/core/src/java/org/apache/solr/metrics/SolrMetricManager.java#L680, it won't create a DelegateRegistryCounter which we only need in some cases.
   
   I'd have to figure out a way to create a counterSupplier to have the context to know to return a Counter or a DelegateRegistryCounter in different situations. This seemed like it was going to start to get messy so I kept it simple here at the cost of the extra weight.



-- 
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@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org