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_: bandwidthCounter should be reset each time it is retrieved otherwise it behaves like an accumulator #5898

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

richard-ramos
Copy link
Member

While adding prometheus bandwidth metrics to go-waku, @AlbertoSoutullo noticed that go-waku service nodes metric value was incorrect.
This PR includes the fix that was applied to the go-waku service node

@richard-ramos richard-ramos changed the title fix: bandwidthCounter should be reset each time it is retrieved otherwise it behaves like an accumulator fix_: bandwidthCounter should be reset each time it is retrieved otherwise it behaves like an accumulator Sep 30, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Sep 30, 2024

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 823db33 #1 2024-09-30 22:03:19 ~1 min tests 📄log
✔️ 823db33 #1 2024-09-30 22:05:22 ~3 min tests-rpc 📄log
✔️ 823db33 #1 2024-09-30 22:06:26 ~4 min linux 📦zip
✔️ 823db33 #1 2024-09-30 22:06:59 ~5 min ios 📦zip
✔️ 823db33 #1 2024-09-30 22:07:05 ~5 min android 📦aar
✔️ e3c5232 #2 2024-09-30 22:07:05 ~1 min tests-rpc 📄log
✔️ e3c5232 #2 2024-09-30 22:08:41 ~2 min linux 📦zip
✔️ e3c5232 #2 2024-09-30 22:08:51 ~1 min android 📦aar
✔️ e3c5232 #2 2024-09-30 22:10:17 ~2 min ios 📦zip
✔️ e3c5232 #2 2024-09-30 22:35:35 ~32 min tests 📄log

@codecov-commenter
Copy link

codecov-commenter commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Please upload report for BASE (develop@031b534). Learn more about missing BASE report.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
wakuv2/waku.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #5898   +/-   ##
==========================================
  Coverage           ?   46.05%           
==========================================
  Files              ?      888           
  Lines              ?   157382           
  Branches           ?        0           
==========================================
  Hits               ?    72488           
  Misses             ?    76569           
  Partials           ?     8325           
Flag Coverage Δ
functional 11.36% <0.00%> (?)
unit 45.63% <0.00%> (?)

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

Files with missing lines Coverage Δ
wakuv2/waku.go 70.51% <0.00%> (ø)

Copy link
Contributor

@chaitanyaprem chaitanyaprem left a comment

Choose a reason for hiding this comment

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

LGTM

one minor comment

go telemetry.PushProtocolStats(w.bandwidthCounter.GetBandwidthByProtocol())
case <-ticker.C:
bandwidthPerProtocol := w.bandwidthCounter.GetBandwidthByProtocol()
w.bandwidthCounter.Reset()
Copy link
Contributor

Choose a reason for hiding this comment

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

does this mean if we want to use GetBandwidthByPeer or some other metric which uses same underlying counter, it will not work right..we will have to get all the metrics in same place and reset the counter

Copy link
Member Author

Choose a reason for hiding this comment

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

Sadly yes, it is not possible to have multiple bandwidth counters

@igor-sirotin igor-sirotin merged commit 7a73743 into develop Oct 2, 2024
11 of 12 checks passed
@igor-sirotin igor-sirotin deleted the reset-bandwidth branch October 2, 2024 13:27
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.

7 participants