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

change(state): Condense CodeTimer::start() and Span::current() calls in state service #6337

Merged
merged 2 commits into from
Mar 18, 2023

Conversation

arya2
Copy link
Contributor

@arya2 arya2 commented Mar 16, 2023

Motivation

There is some redundant code in the state services that starts timers and gets handles to the current span for all request variants.

This PR starts timers and gets the current span before the match statements in the state service call() methods to condense the code.

Solution

  • Start timer and define span at top of state service call() methods

Review

Anyone can review.

Reviewer Checklist

  • Will the PR name make sense to users?
    • Does it need extra CHANGELOG info? (new features, breaking changes, large changes)
  • Are the PR labels correct?
  • Does the code do what the ticket and PR says?
    • Does it change concurrent code, unsafe code, or consensus rules?
  • How do you know it works? Does it have tests?

@arya2 arya2 requested a review from a team as a code owner March 16, 2023 00:12
@arya2 arya2 self-assigned this Mar 16, 2023
@arya2 arya2 requested review from dconnolly and removed request for a team March 16, 2023 00:12
@github-actions github-actions bot added the C-enhancement Category: This is an improvement label Mar 16, 2023
@codecov
Copy link

codecov bot commented Mar 16, 2023

Codecov Report

Merging #6337 (18e6c85) into main (dbdf617) will increase coverage by 0.03%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6337      +/-   ##
==========================================
+ Coverage   77.82%   77.85%   +0.03%     
==========================================
  Files         304      304              
  Lines       39528    39528              
==========================================
+ Hits        30762    30776      +14     
+ Misses       8766     8752      -14     

Copy link
Contributor

@oxarbitrage oxarbitrage left a comment

Choose a reason for hiding this comment

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

Yea, this is good. Is this or remove it completely as i think we used them in the past but not anymore since a while.

I will be ok to go with this approach at least for now.

@arya2 arya2 added C-cleanup Category: This is a cleanup P-Low ❄️ A-state Area: State / database changes C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG labels Mar 17, 2023
mergify bot added a commit that referenced this pull request Mar 18, 2023
@mergify mergify bot merged commit 6d0ce11 into main Mar 18, 2023
@mergify mergify bot deleted the tidy-state-service branch March 18, 2023 15:21
@oxarbitrage oxarbitrage mentioned this pull request Mar 23, 2023
36 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-state Area: State / database changes C-cleanup Category: This is a cleanup C-enhancement Category: This is an improvement C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants