Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZOOKEEPER-4284: Add metrics for observer sync time #1691

Closed
wants to merge 1 commit into from

Conversation

li4wang
Copy link
Contributor

@li4wang li4wang commented May 10, 2021

Motivation

  • With enabling the feature of followers hosting observers, we would need a metric to measure the observer sync time just like what we have for the follower sync time.

Changes

  • Added the "observer_sync_time" metrics
  • Added unit test on the metrics

@li4wang
Copy link
Contributor Author

li4wang commented Jun 10, 2021

@eolivelli @ztzg @hanm @anmolnar would you mind taking a quick look at this PR? It's simple but would be very useful when enabling the follower hosting observers feature. Thanks.

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

completedSync = true;
} finally {
final long syncTime = Time.currentElapsedTime() - startTime;
ServerMetrics.getMetrics().OBSERVER_SYNC_TIME.add(syncTime);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should calculate this time iff completedSync is true. Otherwise, we will get noisy data such as 0 sync time in cases where sync immediately failed (due to network partition for example).

For the same reason the existing follower sync time needs to apply the same fix, which can be done separately.

Copy link
Contributor Author

@li4wang li4wang Jun 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Changed.

I have also opened a JIRA for fix the follower sync time and will submit the fix shortly. https://issues.apache.org/jira/browse/ZOOKEEPER-4318

@hanm Would you mind taking a quick look at the change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hanm thanks for reviewing and approving the follower_sync_time. Can you approve this one, so the change can be merged?

Author: Li Wang <li4wang@gmail.com>
@li4wang
Copy link
Contributor Author

li4wang commented Jun 22, 2021

@hanm can you help approving the PR so the changes can be merged? Thanks.

@hanm
Copy link
Contributor

hanm commented Jun 23, 2021

@hanm can you help approving the PR so the changes can be merged? Thanks.

@hanm can you help approving the PR so the changes can be merged? Thanks.

Apologize for the delay. Approved.

@ztzg ztzg closed this in 2d30656 Jun 30, 2021
Copy link
Contributor

@ztzg ztzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ztzg
Copy link
Contributor

ztzg commented Jun 30, 2021

Merged into master and branch-3.7. Thank you, @li4wang!

ztzg pushed a commit that referenced this pull request Jun 30, 2021
Motivation

- With enabling the feature of followers hosting observers, we would need a metric to measure the observer sync time just like what we have for the follower sync time.

Changes

- Added the "observer_sync_time" metrics
- Added unit test on the metrics

Author: liwang <liwang@apple.com>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Michael Han <hanm@apache.org>, Damien Diederen <ddiederen@apache.org>

Closes #1691 from li4wang/ZOOKEEPER-4284

(cherry picked from commit 2d30656)
Signed-off-by: Damien Diederen <ddiederen@apache.org>
anuragmadnawat1 pushed a commit to anuragmadnawat1/zookeeper that referenced this pull request Nov 2, 2022
Motivation

- With enabling the feature of followers hosting observers, we would need a metric to measure the observer sync time just like what we have for the follower sync time.

Changes

- Added the "observer_sync_time" metrics
- Added unit test on the metrics

Author: liwang <liwang@apple.com>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Michael Han <hanm@apache.org>, Damien Diederen <ddiederen@apache.org>

Closes apache#1691 from li4wang/ZOOKEEPER-4284
anuragmadnawat1 added a commit to anuragmadnawat1/zookeeper that referenced this pull request Nov 2, 2022
Motivation

- With enabling the feature of followers hosting observers, we would need a metric to measure the observer sync time just like what we have for the follower sync time.

Changes

- Added the "observer_sync_time" metrics
- Added unit test on the metrics

Author: liwang <liwang@apple.com>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Michael Han <hanm@apache.org>, Damien Diederen <ddiederen@apache.org>

Closes apache#1691 from li4wang/ZOOKEEPER-4284

Co-authored-by: liwang <liwang@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants