-
Notifications
You must be signed in to change notification settings - Fork 249
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 connection failure metric #5518
Conversation
Jenkins BuildsClick to see older builds (10)
|
ce321af
to
570ef17
Compare
570ef17
to
261dfa8
Compare
261dfa8
to
a274a15
Compare
@@ -125,6 +123,9 @@ func (w *Waku) broadcast() { | |||
} | |||
} | |||
|
|||
// Wraps the publish function with rate limiter | |||
fn = w.limiter.ThrottlePublishFn(w.ctx, fn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richard-ramos I moved the rate limit wrapper after the telemetry wrapper so that rate limiting doesn't get caught as a publish error
body, _ := json.Marshal(postBody) | ||
jsonRawMessage := json.RawMessage(body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We marshal and unmarshal here 🤔. And then we marshal again here:
Line 230 in 780e3e5
body, err := json.Marshal(c.telemetryRetryCache) |
It would be nice to reduce these procedures. We could change Client.TelemetryData
type to interface{}
and pass the postBody
pointer directly. And then just call json.Marshal
on it.
I guess it can be done out of this PR ofc.
nextIdLock sync.Mutex | ||
nextId int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion, out of this PR
nextIdLock sync.Mutex | |
nextId int | |
nextId atomic.Int32 |
A short summary which serves as a squashed-commit message.
A description to understand introduced changes without reading the code.
Important changes:
Related to status-im/telemetry#21