tkhurana opened a new pull request, #2492: URL: https://github.com/apache/phoenix/pull/2492
## Summary Adds finer-grained histograms in `MetricsReplicationLogGroupSource` to give better visibility into where time is spent inside `ReplicationLogGroup`: - **`fsSyncTime`** (renamed from `modeSyncTime`) — wall time of the underlying filesystem sync (`fsync`) inside `processPendingSyncs`. Recorded in a `try/finally` so failures are captured too. - **`pendingSyncWaitTime`** — per-pending-sync wait between consumer pickup of a SYNC event and the start of `fsync`. Helps quantify within-batch drain (events the consumer processes between picking up the SYNC marker and reaching `endOfBatch`). - **`pendingSyncCount`** — number of sync futures coalesced into a single fsync. Indicates how well the disruptor batches sync calls. - **`batchSize`** — number of events drained per disruptor batch. Counter is reset in a `finally` block on `endOfBatch` so the value never leaks across batches when an exception path bypasses `processPendingSyncs`. - **`rotationTime`** — was declared but never populated; now instrumented in `ReplicationLog.LogRotationTask.run` and recorded on both success and failure paths. To support `pendingSyncWaitTime`, a `PendingSync` private holder class is introduced inside `LogEventHandler`. It retains the `CompletableFuture<Void>` and the `nanoTime()` pickup timestamp so per-SYNC wait can be measured safely across the disruptor `onEvent` boundary (retaining a `LogEvent` reference past `onEvent` return is unsafe because the producer may overwrite the slot). `ReplicationLogMetricValues` is converted to a builder to avoid positional-argument hazards as the metric set grows (now 11 same-typed `long` parameters). Adding the next metric becomes a one-line builder method. The integration test `ReplicationLogGroupIT.assertMetricsEmitted` is extended to assert the new histograms fire. ## Test plan - [ ] `mvn test -pl phoenix-core -Dtest=ReplicationLogGroupTest` passes - [ ] `mvn verify -pl phoenix-core -Dit.test=ReplicationLogGroupIT` passes - [ ] `mvn spotless:check` passes - [ ] After deployment, verify new histograms appear under `RegionServer,sub=ReplicationLogGroup,haGroup=...` JMX context with non-zero values during sustained workload -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
