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

metrics: fix may count metrics multiple times #4654

Merged
merged 3 commits into from May 9, 2019

Conversation

Projects
None yet
5 participants
@Connor1996
Copy link
Member

commented May 8, 2019

What have you changed? (mandatory)

Update metrics only when all exec_results are finished in case the metrics are counted multiple times
because when waiting for commit merge it may call on_ready_res multiple times.

What are the type of the changes? (mandatory)

  • Bug fix (change which fixes an issue)

How has this PR been tested? (mandatory)

No

Does this PR affect documentation (docs) or release note? (mandatory)

No

Does this PR affect tidb-ansible update? (mandatory)

No

fix count metrics multiple times
Signed-off-by: Connor1996 <zbk602423539@gmail.com>

@Connor1996 Connor1996 added T: BugFix C: Raft and removed C: Raft labels May 8, 2019

@@ -1994,6 +1990,13 @@ impl<'a, T: Transport, C: PdClient> PeerFsmDelegate<'a, T, C> {
ExecResult::IngestSST { ssts } => self.on_ingest_sst_result(ssts),
}
}

// Update metrics only when all exec_results are finished in case the metrics is counted multiple times

This comment has been minimized.

Copy link
@BusyJay

BusyJay May 8, 2019

Contributor

Can this be skipped if exec_results is empty?

This comment has been minimized.

Copy link
@Connor1996

Connor1996 May 8, 2019

Author Member

Yes, when exec_results is empty, on_ready_res would return directly at the beginning.

This comment has been minimized.

Copy link
@BusyJay

BusyJay May 8, 2019

Contributor

Is it expected?

This comment has been minimized.

Copy link
@Connor1996

Connor1996 May 8, 2019

Author Member

oh, I was thought when the exec_results is empty, the metrics are zeros. Fix it.

not skip empty
Signed-off-by: Connor1996 <zbk602423539@gmail.com>

@Connor1996 Connor1996 force-pushed the Connor1996:ready-res-metrics branch from d5bf4ee to f0ca1fa May 8, 2019

@BusyJay

BusyJay approved these changes May 9, 2019

@siddontang
Copy link
Contributor

left a comment

LGTM

@Connor1996 Connor1996 added the S: LGT2 label May 9, 2019

@kennytm kennytm merged commit 7fd27a4 into tikv:master May 9, 2019

2 checks passed

DCO All commits are signed off!
Details
idc-jenkins-ci/test Jenkins job succeeded.
Details

@Connor1996 Connor1996 deleted the Connor1996:ready-res-metrics branch May 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.