Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

chore(BUX-351): improve logging when requesting Pulse #549

Merged
merged 3 commits into from
Jan 29, 2024

Conversation

chris-4chain
Copy link
Contributor

@chris-4chain chris-4chain commented Jan 26, 2024

Pull Request Checklist

  • πŸ“– I created my PR using provided : CODE_STANDARDS
  • πŸ“– I have read the short Code of Conduct: CODE_OF_CONDUCT
  • 🏠 I tested my changes locally.
  • βœ… I have provided tests for my changes.
  • πŸ“ I have used conventional commits.
  • πŸ“— I have updated any related documentation.
  • πŸ’Ύ PR was issued based on the Github or Jira issue.

While doing this task, I discovered that, every time a request to our Pulse service is made, a new http.Client is created. I've change it - so that now, only one http.Client is created during the initialization stage.

From golang documentation:

A Client is an HTTP client. Its zero value (DefaultClient) is a usable client that uses DefaultTransport.

The Client's Transport typically has internal state (cached TCP connections), so Clients should be reused instead of created as needed. Clients are safe for concurrent use by multiple goroutines.

@chris-4chain chris-4chain requested a review from a team as a code owner January 26, 2024 09:11
@mergify mergify bot added the update General updates label Jan 26, 2024
Copy link
Contributor

mergify bot commented Jan 26, 2024

Welcome to our open-source project @chris-4chain! πŸ’˜

Copy link

codecov bot commented Jan 26, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (a011827) 53.28% compared to head (97b5bd1) 53.89%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #549      +/-   ##
==========================================
+ Coverage   53.28%   53.89%   +0.60%     
==========================================
  Files         110      110              
  Lines       10854    10853       -1     
==========================================
+ Hits         5784     5849      +65     
+ Misses       4605     4533      -72     
- Partials      465      471       +6     
Flag Coverage Ξ”
unittests 53.89% <83.33%> (+0.60%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Ξ”
chainstate/client.go 65.95% <ΓΈ> (ΓΈ)
chainstate/client_options.go 74.25% <100.00%> (+3.96%) ⬆️
chainstate/merkle_root.go 83.33% <100.00%> (+83.33%) ⬆️
chainstate/merkle_root_provider.go 66.66% <80.00%> (+66.66%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data
Powered by Codecov. Last update a011827...97b5bd1. Read the comment docs.

@chris-4chain chris-4chain merged commit 3ed84e6 into master Jan 29, 2024
11 checks passed
@chris-4chain chris-4chain deleted the chore-351-pulse-req-logging branch January 29, 2024 08:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
update General updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants