Renamed Replicator#getStats to Replicator#computeStats, as it modifies the underlying object in the process. Added a simple getter Replicator#getStats for the object itself. This helps clarify the intent of the methods.
Verifying this change
[x] Make sure that the change passes the CI checks.
This change added tests and can be verified as follows:
Added test ReplicatorTest#testReplicationMetrics
Updated test ReplicatorTest#testResumptionAfterBacklogRelaxed
Does this pull request potentially affect one of the following parts:
PIP-264
Motivation
Adds existing broker replicator metrics (documented by https://pulsar.apache.org/docs/next/reference-metrics/#replication-metrics-1) to the OpenTelemetry pipeline.
Modifications
Replicator#getStats
toReplicator#computeStats
, as it modifies the underlying object in the process. Added a simple getterReplicator#getStats
for the object itself. This helps clarify the intent of the methods.Verifying this change
This change added tests and can be verified as follows:
ReplicatorTest#testReplicationMetrics
ReplicatorTest#testResumptionAfterBacklogRelaxed
Does this pull request potentially affect one of the following parts:
Documentation
doc
doc-required
https://github.com/apache/pulsar-site/pull/926doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: https://github.com/dragosvictor/pulsar/pull/26