You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/04/29 15:55:45 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #5733: [Metric] Metric for table/partition level query count

morningman commented on a change in pull request #5733:
URL: https://github.com/apache/incubator-doris/pull/5733#discussion_r623184517



##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/Partition.java
##########
@@ -500,4 +508,17 @@ public boolean convertRandomDistributionToHashDistribution(List<Column> baseSche
         }
         return hasChanged;
     }
+
+    private static void registerMetric(Partition partition) {
+        GaugeMetric<Long> gauge = new GaugeMetric<Long>("partition_query_count",
+                Metric.MetricUnit.NOUNIT, "partition query count") {
+            @Override
+            public Long getValue() {
+                return partition.partition_query_count.longValue();
+            }
+        };
+        gauge.addLabel(new MetricLabel("partition_name", partition.getName()));
+        gauge.addLabel(new MetricLabel("partition_id", String.valueOf(partition.getId())));
+        MetricRepo.addMetric(gauge);

Review comment:
       Are you sure to add gauge for each partition? There will be a huge number of 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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org