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

feat(telemetry)_: send peer count metric #5460

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Conversation

adklempner
Copy link
Contributor

@adklempner adklempner commented Jul 1, 2024

When peer count timer is fired and peer count has changed, send a message to telemetry service indicating the node's peer count at the current timestamp.

Also logs decoded error from telemetry service and fixes expected response code.

Important changes:

Related to status-im/telemetry#21

@status-im-auto
Copy link
Member

status-im-auto commented Jul 1, 2024

Jenkins Builds

Click to see older builds (13)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 96d84bc #1 2024-07-01 22:44:35 ~3 min linux 📦zip
✔️ 96d84bc #1 2024-07-01 22:45:57 ~5 min ios 📦zip
✔️ 96d84bc #1 2024-07-01 22:46:19 ~5 min android 📦aar
✔️ 96d84bc #1 2024-07-01 23:25:32 ~44 min tests 📄log
✔️ 42e6ef7 #2 2024-07-03 00:33:40 ~3 min ios 📦zip
✔️ 42e6ef7 #2 2024-07-03 00:34:27 ~3 min linux 📦zip
✔️ 42e6ef7 #2 2024-07-03 00:35:45 ~5 min android 📦aar
✖️ 42e6ef7 #2 2024-07-03 01:15:52 ~45 min tests 📄log
✔️ 0042450 #1 2024-07-12 01:34:29 ~3 min tests-rpc 📄log
✔️ 0042450 #3 2024-07-12 01:35:07 ~3 min ios 📦zip
✔️ 0042450 #3 2024-07-12 01:35:29 ~4 min linux 📦zip
✔️ 0042450 #3 2024-07-12 01:38:48 ~7 min android 📦aar
✖️ 0042450 #3 2024-07-12 02:16:05 ~44 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 4c51832 #4 2024-07-12 03:18:30 ~1 min android 📦aar
✔️ 4c51832 #4 2024-07-12 03:18:57 ~1 min linux 📦zip
✖️ 4c51832 #4 2024-07-12 03:19:34 ~2 min tests 📄log
✔️ 4c51832 #2 2024-07-12 03:19:35 ~2 min tests-rpc 📄log
✔️ 4c51832 #4 2024-07-12 03:20:11 ~3 min ios 📦zip
✔️ b0b3064 #5 2024-07-12 03:25:25 ~1 min android 📦aar
✔️ b0b3064 #3 2024-07-12 03:26:16 ~2 min tests-rpc 📄log
✔️ b0b3064 #5 2024-07-12 03:27:22 ~3 min linux 📦zip
✔️ b0b3064 #5 2024-07-12 03:27:32 ~3 min ios 📦zip
✔️ b0b3064 #5 2024-07-12 04:07:04 ~43 min tests 📄log

@adklempner adklempner marked this pull request as ready for review July 3, 2024 00:43
wakuv2/waku.go Outdated
@@ -1399,16 +1400,21 @@ func (w *Waku) Start() error {
case <-peerCountTimer.C:
peerCountTimer.Reset(3 * time.Second)
newPeerCount := len(w.node.Host().Network().Peers())
if newPeerCount != peerCount && w.onPeerStats != nil {
if newPeerCount != peerCount && (w.onPeerStats != nil || w.statusTelemetryClient != nil) {
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we want to set peerCount is onPeerStats and statusTelemetryClient are nil? IMO you don't need to check for the nil here since you also do it later - or am I missing anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We update the peer count if either one is true. We only call onPeerStats and/or statusTelemetryClient if either one is set.

Copy link
Member

@vpavlin vpavlin left a comment

Choose a reason for hiding this comment

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

LGTM in general, added one comment

@adklempner adklempner force-pushed the feat/peer-count-metric branch 2 times, most recently from 0042450 to 4c51832 Compare July 12, 2024 03:16
@adklempner adklempner merged commit a006d80 into develop Jul 12, 2024
10 checks passed
@adklempner adklempner deleted the feat/peer-count-metric branch July 12, 2024 20:37
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.

4 participants