-
Notifications
You must be signed in to change notification settings - Fork 820
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
stream/multiconnection: Default process reporter #1734
base: master
Are you sure you want to change the base?
Conversation
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.
Looks good!
[DEBUG] | WEBSOCKET | 04/12/2024 09:41:05 | wss://op-ws.gateio.live/v4/ws: Operations/Second: 0, Avg Processing/Operation: 124.162µs, Peak: 786.542µs
...
[DEBUG] | WEBSOCKET | 04/12/2024 09:42:05 | wss://op-ws.gateio.live/v4/ws: Operations/Second: 1, Avg Processing/Operation: 127.424µs, Peak: 317.791µs
exchanges/stream/reporting.go
Outdated
// Reset metrics for the next interval. | ||
r.operations, r.totalProcessingTime, r.peakProcessingTime = 0, 0, 0 |
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.
I think there'd be value in not resetting some so you can know the slowest ever etc. Trudging through logs looking for the highest number doesn't sound so good, but I don't really feel strongly to make you change it
edit: I SEE YOUR EYES. I think there is still great value in highlighting the slowest thing across all time. But I will add it for myself
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.
I like this, thank you!
Co-authored-by: Scott <[email protected]>
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.
Nice! tACK! Optional minor changes that don't affect tackiness
exchanges/stream/reporting.go
Outdated
peakCause = append(peakCause[:100], []byte("...")...) | ||
} | ||
// Log metrics outside of the critical section to avoid blocking other threads. | ||
log.Debugf(log.WebsocketMgr, "Connection: %v Operations/Second: %.2f, Avg Processing/Operation: %v, Errors: %v Peak: %v Cause: %v...", conn.GetURL(), avgOperationsPerSecond, avgProcessingTime, errors, peakTime, string(peakCause)) |
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.
peakCause = append(peakCause[:100], []byte("...")...) | |
} | |
// Log metrics outside of the critical section to avoid blocking other threads. | |
log.Debugf(log.WebsocketMgr, "Connection: %v Operations/Second: %.2f, Avg Processing/Operation: %v, Errors: %v Peak: %v Cause: %v...", conn.GetURL(), avgOperationsPerSecond, avgProcessingTime, errors, peakTime, string(peakCause)) | |
peakCause = append(peakCause[:100], []byte("...")...) | |
} | |
// Log metrics outside of the critical section to avoid blocking other threads. | |
log.Debugf(log.WebsocketMgr, "Connection: %v Operations/Second: %.2f, Avg Processing/Operation: %v, Errors: %v Peak: %v Cause: %v", conn.GetURL(), avgOperationsPerSecond, avgProcessingTime, errors, peakTime, string(peakCause)) |
I removed the ellipses in the main output because you add them if its > 100 and doesn't really mean much if < 100
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.
done
Co-authored-by: Scott <[email protected]>
PR Description
WebsocketMetricsLogging
to true (only for Gateio) functionality will expand when exchanges get converted over themulti-connection
usage.Reasoning:
peak processing timing
which needs to be investigated.Opened as draft if this could be a potential update. Once look over is done I will write tests and cleanup.Type of change
Please delete options that are not relevant and add an
x
in[]
as item is complete.How has this been tested
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration and
also consider improving test coverage whilst working on a certain feature or package.
Checklist