This patch adds several metrics defined in KIP-866:
* MigratingZkBrokerCount: the number of zk brokers registered with KRaft
* ZkWriteDeltaTimeMs: time spent writing MetadataDelta to ZK
* ZkWriteSnapshotTimeMs: time spent writing MetadataImage to ZK
* Adds value 4 for "ZK" to ZkMigrationState
Also fixes a typo in the metric name introduced in #14009 (ZKWriteBehindLag -> ZkWriteBehindLag)
Reviewers: Luke Chen <showuon@gmail.com>, Colin P. McCabe <cmccabe@apache.org>
@ -1273,6 +1273,8 @@ public final class QuorumController implements Controller {
@@ -1273,6 +1273,8 @@ public final class QuorumController implements Controller {
@ -39,6 +39,8 @@ public final class ControllerMetadataMetrics implements AutoCloseable {
@@ -39,6 +39,8 @@ public final class ControllerMetadataMetrics implements AutoCloseable {
@ -55,6 +57,7 @@ public final class ControllerMetadataMetrics implements AutoCloseable {
@@ -55,6 +57,7 @@ public final class ControllerMetadataMetrics implements AutoCloseable {
@ -65,7 +68,7 @@ public final class ControllerMetadataMetrics implements AutoCloseable {
@@ -65,7 +68,7 @@ public final class ControllerMetadataMetrics implements AutoCloseable {
@ -117,6 +120,14 @@ public final class ControllerMetadataMetrics implements AutoCloseable {
@@ -117,6 +120,14 @@ public final class ControllerMetadataMetrics implements AutoCloseable {
@ -143,6 +154,18 @@ public final class ControllerMetadataMetrics implements AutoCloseable {
@@ -143,6 +154,18 @@ public final class ControllerMetadataMetrics implements AutoCloseable {
@ -212,6 +235,7 @@ public final class ControllerMetadataMetrics implements AutoCloseable {
@@ -212,6 +235,7 @@ public final class ControllerMetadataMetrics implements AutoCloseable {
@ -124,15 +124,21 @@ public class ControllerMetadataMetricsPublisher implements MetadataPublisher {
@@ -124,15 +124,21 @@ public class ControllerMetadataMetricsPublisher implements MetadataPublisher {
@ -45,7 +45,11 @@ public class QuorumControllerMetrics implements AutoCloseable {
@@ -45,7 +45,11 @@ public class QuorumControllerMetrics implements AutoCloseable {
@ -71,6 +75,9 @@ public class QuorumControllerMetrics implements AutoCloseable {
@@ -71,6 +75,9 @@ public class QuorumControllerMetrics implements AutoCloseable {
@ -88,7 +95,7 @@ public class QuorumControllerMetrics implements AutoCloseable {
@@ -88,7 +95,7 @@ public class QuorumControllerMetrics implements AutoCloseable {
publicQuorumControllerMetrics(
Optional<MetricsRegistry>registry,
Timetime,
booleanzkMigrationState
booleanzkMigrationEnabled
){
this.registry=registry;
this.active=false;
@ -148,7 +155,8 @@ public class QuorumControllerMetrics implements AutoCloseable {
@@ -148,7 +155,8 @@ public class QuorumControllerMetrics implements AutoCloseable {
@ -158,6 +166,11 @@ public class QuorumControllerMetrics implements AutoCloseable {
@@ -158,6 +166,11 @@ public class QuorumControllerMetrics implements AutoCloseable {
@ -177,6 +190,14 @@ public class QuorumControllerMetrics implements AutoCloseable {
@@ -177,6 +190,14 @@ public class QuorumControllerMetrics implements AutoCloseable {
@ -255,7 +276,9 @@ public class QuorumControllerMetrics implements AutoCloseable {
@@ -255,7 +276,9 @@ public class QuorumControllerMetrics implements AutoCloseable {
@ -475,12 +475,17 @@ public class KRaftMigrationDriver implements MetadataPublisher {
@@ -475,12 +475,17 @@ public class KRaftMigrationDriver implements MetadataPublisher {
log.trace("Did not make any ZK writes when handling KRaft {}",isSnapshot?"snapshot":"delta");
@ -556,6 +561,8 @@ public class KRaftMigrationDriver implements MetadataPublisher {
@@ -556,6 +561,8 @@ public class KRaftMigrationDriver implements MetadataPublisher {
log.error("KRaft controller indicates a completed migration, but the migration driver is somehow active.");
@ -658,8 +665,11 @@ public class KRaftMigrationDriver implements MetadataPublisher {
@@ -658,8 +665,11 @@ public class KRaftMigrationDriver implements MetadataPublisher {