You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by yu...@apache.org on 2021/05/03 04:27:26 UTC
[incubator-pinot] branch master updated: add a metirc of ideal
state size after gzip (#6870)
This is an automated email from the ASF dual-hosted git repository.
yupeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 1c09b78 add a metirc of ideal state size after gzip (#6870)
1c09b78 is described below
commit 1c09b7866b4d1c8267847f464e9c4618787b5a15
Author: Yupeng Fu <yu...@users.noreply.github.com>
AuthorDate: Sun May 2 21:27:00 2021 -0700
add a metirc of ideal state size after gzip (#6870)
* add a metirc of ideal state size after gzip
* comments
* format
---
docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml | 5 +++++
.../main/java/org/apache/pinot/common/metrics/ControllerGauge.java | 1 +
.../java/org/apache/pinot/controller/helix/SegmentStatusChecker.java | 4 ++++
3 files changed, 10 insertions(+)
diff --git a/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml b/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml
index 40cd394..9b38cc9 100644
--- a/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml
+++ b/docker/images/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml
@@ -11,6 +11,11 @@ rules:
labels:
table: "$1"
tableType: "$2"
+- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", name=\"pinot.controller.idealstateZnodeByteSize.(\\w+)_(\\w+)\"><>(\\w+)"
+ name: "pinot_controller_idealstateZnodeByteSize_$3"
+ labels:
+ table: "$1"
+ tableType: "$2"
- pattern: "\"org.apache.pinot.common.metrics\"<type=\"ControllerMetrics\", name=\"pinot.controller.numberOfReplicas.(\\w+)_(\\w+)\"><>(\\w+)"
name: "pinot_controller_numberOfReplicas_$3"
labels:
diff --git a/pinot-common/src/main/java/org/apache/pinot/common/metrics/ControllerGauge.java b/pinot-common/src/main/java/org/apache/pinot/common/metrics/ControllerGauge.java
index 243a1a8..1ebeac1 100644
--- a/pinot-common/src/main/java/org/apache/pinot/common/metrics/ControllerGauge.java
+++ b/pinot-common/src/main/java/org/apache/pinot/common/metrics/ControllerGauge.java
@@ -40,6 +40,7 @@ public enum ControllerGauge implements AbstractMetrics.Gauge {
SEGMENT_COUNT("SegmentCount", false),
IDEALSTATE_ZNODE_SIZE("idealstate", false),
+ IDEALSTATE_ZNODE_BYTE_SIZE("idealstate", false),
REALTIME_TABLE_COUNT("TableCount", true),
OFFLINE_TABLE_COUNT("TableCount", true),
DISABLED_TABLE_COUNT("TableCount", true),
diff --git a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/SegmentStatusChecker.java b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/SegmentStatusChecker.java
index 9501b28..193416c 100644
--- a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/SegmentStatusChecker.java
+++ b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/SegmentStatusChecker.java
@@ -21,6 +21,7 @@ package org.apache.pinot.controller.helix;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
+import org.apache.helix.manager.zk.ZNRecordSerializer;
import org.apache.helix.model.ExternalView;
import org.apache.helix.model.IdealState;
import org.apache.pinot.common.metadata.segment.OfflineSegmentZKMetadata;
@@ -50,6 +51,7 @@ public class SegmentStatusChecker extends ControllerPeriodicTask<SegmentStatusCh
// log messages about disabled tables atmost once a day
private static final long DISABLED_TABLE_LOG_INTERVAL_MS = TimeUnit.DAYS.toMillis(1);
+ private static final ZNRecordSerializer _recordSerializer = new ZNRecordSerializer();
private long _lastDisabledTableLogTimestamp = 0;
/**
@@ -146,6 +148,8 @@ public class SegmentStatusChecker extends ControllerPeriodicTask<SegmentStatusCh
_controllerMetrics
.setValueOfTableGauge(tableNameWithType, ControllerGauge.IDEALSTATE_ZNODE_SIZE, idealState.toString().length());
+ _controllerMetrics.setValueOfTableGauge(tableNameWithType, ControllerGauge.IDEALSTATE_ZNODE_BYTE_SIZE,
+ idealState.serialize(_recordSerializer).length);
_controllerMetrics.setValueOfTableGauge(tableNameWithType, ControllerGauge.SEGMENT_COUNT,
(long) (idealState.getPartitionSet().size()));
ExternalView externalView = _pinotHelixResourceManager.getTableExternalView(tableNameWithType);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org