You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "HoustonPutman (via GitHub)" <gi...@apache.org> on 2023/05/24 20:04:17 UTC

[GitHub] [solr] HoustonPutman opened a new pull request, #1661: SOLR-16816: Update node metrics when making affinityPlacement selections

HoustonPutman opened a new pull request, #1661:
URL: https://github.com/apache/solr/pull/1661

   https://issues.apache.org/jira/browse/SOLR-16816
   
   This is not backcompat for people using custom PlacementPlugin implementations, but we could just use a NO-OP for `increase()` and `decrease()` if that is an issue.
   
   Unfortunately I had to refactor the built in metrics, as you can't use a subclass as a static variable in the superclass.


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


[GitHub] [solr] tflobbe commented on a diff in pull request #1661: SOLR-16816: Update node metrics when making affinityPlacement selections

Posted by "tflobbe (via GitHub)" <gi...@apache.org>.
tflobbe commented on code in PR #1661:
URL: https://github.com/apache/solr/pull/1661#discussion_r1206068336


##########
solr/core/src/java/org/apache/solr/cluster/placement/impl/BuiltInMetrics.java:
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.cluster.placement.impl;
+
+import org.apache.solr.cluster.placement.NodeMetric;
+import org.apache.solr.common.cloud.rule.ImplicitSnitch;
+
+/** Node and Replica Metrics available to the placement plugins */
+public class BuiltInMetrics {
+
+  /*
+   * Node Metrics
+   */
+
+  /** Total disk space in GB. */
+  public static final NodeMetricImpl<Double> NODE_TOTAL_DISK_GB =
+      new NodeMetricImpl.DoubleNodeMetricImpl(
+          "totalDisk",
+          NodeMetric.Registry.SOLR_NODE,
+          "CONTAINER.fs.totalSpace",
+          MetricImpl.BYTES_TO_GB_CONVERTER);
+
+  /** Free (usable) disk space in GB. */
+  public static final NodeMetricImpl<Double> NODE_FREE_DISK_GB =
+      new NodeMetricImpl.DoubleNodeMetricImpl(
+          "freeDisk",
+          NodeMetric.Registry.SOLR_NODE,
+          "CONTAINER.fs.usableSpace",
+          MetricImpl.BYTES_TO_GB_CONVERTER);
+
+  /** Number of all cores. */
+  public static final NodeMetricImpl<Integer> NODE_NUM_CORES =
+      new NodeMetricImpl.IntNodeMetricImpl(ImplicitSnitch.CORES);
+
+  public static final NodeMetricImpl<Double> NODE_HEAP_USAGE =
+      new NodeMetricImpl.DoubleNodeMetricImpl(ImplicitSnitch.HEAPUSAGE);
+
+  /** System load average. */
+  public static final NodeMetricImpl<Double> NODE_SYSLOAD_AVG =
+      new NodeMetricImpl.DoubleNodeMetricImpl(
+          "sysLoadAvg", NodeMetric.Registry.SOLR_JVM, "os.systemLoadAverage");
+
+  /** Number of available processors. */
+  public static final NodeMetricImpl<Integer> NODE_AVAILABLE_PROCESSORS =
+      new NodeMetricImpl.IntNodeMetricImpl(
+          "availableProcessors", NodeMetric.Registry.SOLR_JVM, "os.availableProcessors");
+
+  /*
+   * Node Metrics

Review Comment:
   Replica Metrics



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


[GitHub] [solr] HoustonPutman commented on pull request #1661: SOLR-16816: Update node metrics when making affinityPlacement selections

Posted by "HoustonPutman (via GitHub)" <gi...@apache.org>.
HoustonPutman commented on PR #1661:
URL: https://github.com/apache/solr/pull/1661#issuecomment-1563273492

   Tests added!


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


[GitHub] [solr] HoustonPutman merged pull request #1661: SOLR-16816: Update node metrics when making affinityPlacement selections

Posted by "HoustonPutman (via GitHub)" <gi...@apache.org>.
HoustonPutman merged PR #1661:
URL: https://github.com/apache/solr/pull/1661


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