-
Notifications
You must be signed in to change notification settings - Fork 4.6k
transport: add metrics when it s active #8573
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8573 +/- ##
==========================================
+ Coverage 80.91% 82.20% +1.29%
==========================================
Files 413 415 +2
Lines 40751 40712 -39
==========================================
+ Hits 32972 33467 +495
+ Misses 6155 5877 -278
+ Partials 1624 1368 -256
🚀 New features to boost your workflow:
|
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.
Thanks for sending the PR, nice job writing a unit test for this!
@arjan-bal thx for the review, i updated additional comments |
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.
LGTM, with a minor comment. Assigning a second reviewer.
} | ||
|
||
// Always create a real stream through the client | ||
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond) |
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: We should create a context at the beginning of t.Run
with a timeout of defaultTestTimeout
. This should help ensure that the entire test case finishes within 10 seconds.
t.Run(test.name, func(t *testing.T) { | ||
// Setup server configuration with channelz support | ||
serverConfig := &ServerConfig{ | ||
ChannelzParent: channelz.RegisterServer("test server"), |
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: Could we use t.Name()
as the name for this server so that the two tests in the table get different names.
@hugehoo : Please take care of the couple of minor nitty comments. Thanks for your contribution again. |
Also, the PR title seems to be broken. Could you please fix that too. |
Fixes: #8529
This PR fixes to increment metrics only when the stream is active which is found in the activeStreams map.
as-is
to-be
RELEASE NOTES: