-
Notifications
You must be signed in to change notification settings - Fork 4.5k
stats: Improved sequencing documentation for server-side stats events and added tests. #7885
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
stats: Improved sequencing documentation for server-side stats events and added tests. #7885
Conversation
…s to verify the order of server-side events.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7885 +/- ##
==========================================
+ Coverage 81.84% 82.01% +0.16%
==========================================
Files 377 410 +33
Lines 38120 40251 +2131
==========================================
+ Hits 31201 33013 +1812
- Misses 5603 5877 +274
- Partials 1316 1361 +45
🚀 New features to boost your workflow:
|
stats/stats_test.go
Outdated
func (s *testServer) UnaryCall( | ||
ctx context.Context, | ||
in *testpb.SimpleRequest, | ||
) (*testpb.SimpleResponse, error) { |
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.
grpc-go follows the Google style guide. Based on this section in the style guide:
The signature of a function or method declaration should remain on a single line to avoid indentation confusion.
Please revert the changes made to wrap function definationations and calls throughout the PR.
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.
Got it! I'll disable my autoformatter going forward or reconfigure it to follow the Google style guide.
stats/stats_test.go
Outdated
@@ -786,8 +884,14 @@ func checkConnEnd(t *testing.T, d *gotData) { | |||
st.IsClient() // TODO remove this. | |||
} | |||
|
|||
type event struct { | |||
eventType string | |||
timestamp time.Time |
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.
What is the use of storing a timestamp? I believe we're only interested in the ordering of the events and not the absolute times they were emitted.
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.
The timestamp was included for debugging purposes in case of test failures, since it could help identify delays or other issues. If you feel this isn’t valuable, I can to remove it for simplicity.
I have fixed the wrapping errors for formatting and I removed the timestamps from the event structs. Thank you for your feedback @arjan-bal, is there anything else you need me to do? |
…. Added a server stats Server Stream RPC test.
stats/stats_test.go
Outdated
@@ -81,6 +83,55 @@ var ( | |||
} | |||
// The id for which the service handler should return error. | |||
errorID int32 = 32202 | |||
|
|||
// Server Stats |
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.
Please fix the documentation everywhere. Remove extra spaces at start and end etc.
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.
Everything should be resolved now. Thank you for your help!
This PR is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed. |
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.
Thank you!
stats/stats_test.go
Outdated
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.
Could we just revert this file now? It mostly looks like churn which makes the blame history harder to navigate.
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.
Yeah fair enough. Since I removed the tests anyway.
Thanks! Over to @purnesh42H for a quick second pass. |
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.
@RyanBlaney 1 more nit else looks good.
stats/stats.go
Outdated
// Begin contains stats when an RPC attempt begins. | ||
// Begin contains stats for the start of an RPC attempt. | ||
// | ||
// - Server-side: Triggered after `InHeader`, as headers are processed before the RPC lifecycle begins. |
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.
nit: restrict comments to 80 cols per line
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.
Got it! Thanks!
… and added tests. (grpc#7885)
Response to Issue #7824
RELEASE NOTES: