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

Fix replication task execution latency #3671

Merged
merged 2 commits into from
Nov 28, 2022

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented Nov 28, 2022

What changed?
Fix pattern on defer when emitting latency metrics.

Why?
Cannot call timer in defer directly.

How did you test it?

Potential risks

Is hotfix candidate?
Yes

@yux0 yux0 requested a review from a team as a code owner November 28, 2022 19:24
Copy link
Collaborator

@rodrigozhou rodrigozhou left a comment

Choose a reason for hiding this comment

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

Changes look good to me, but wondering if it would be better to have an util function for this instead of creating lambda functions all over the code. Something like this:

func RecordLatency(startTime time.Time, metric metrics.TimerMetric, tags ...metrics.Tag) {
	metric.Record(time.Since(startTime), tags...)
}

@yux0 yux0 merged commit 997434c into temporalio:master Nov 28, 2022
@yux0 yux0 deleted the fix-replication-lag branch November 28, 2022 20:33
yux0 added a commit that referenced this pull request Nov 28, 2022
* Fix replication task execution latency

* Fix emit latency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants