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

stats: add BeginTime to stats.End #1907

Merged
merged 2 commits into from
Mar 12, 2018
Merged

stats: add BeginTime to stats.End #1907

merged 2 commits into from
Mar 12, 2018

Conversation

btc
Copy link
Contributor

@btc btc commented Mar 8, 2018

This change allows stats.Handler implementations easily determine duration.

@thelinuxfoundation
Copy link

Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement.

After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.

Regards,
CLA GitHub bot

@btc
Copy link
Contributor Author

btc commented Mar 8, 2018

I completed the CLA form.

@dfawley dfawley self-requested a review March 8, 2018 21:21
@dfawley dfawley self-assigned this Mar 8, 2018
Client: true,
Error: err,
BeginTime: beginTime,
EndTime: time.Now(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that end time was not being set here.

@dfawley
Copy link
Member

dfawley commented Mar 12, 2018

Thanks for the PR.

I'm fine with this change, but with the caveat that this API is experimental and will be redesigned in the somewhat-near future. There is a fundamental problem with this stats API and the capabilities of replay. I plan to address this in a gRFC at some point in the future.

In a revamp, I don't intend to pass either begin or end time, since those are literally time.Now() right before the stats handler is called; the stats handler can keep track of time on its own instead, if needed.

@dfawley dfawley changed the title add BeginTime to stats.End stats: add BeginTime to stats.End Mar 12, 2018
@dfawley dfawley merged commit 2c2d834 into grpc:master Mar 12, 2018
@btc
Copy link
Contributor Author

btc commented Mar 12, 2018

Are there preliminary comments about the "capabilities of replay" you mention?

@dfawley
Copy link
Member

dfawley commented Mar 12, 2018

Are there preliminary comments about the "capabilities of replay" you mention?

Sorry, I meant to say "retry", but it's specifically the replaying of messages that are a problem. The gRFC for retry is here for reference. The issue with stats is that we include the message payload in the call to the stats handler, but the payload is no longer owned by gRPC after the Send() call that contains it returns. However, we may need to retransmit that message on subsequent retry attempts.

Generally, though, the stats API wasn't designed with retry in mind. E.g. there is no distinction between an RPC call being performed by the application and individual attempts being sent on the wire.

@btc
Copy link
Contributor Author

btc commented Mar 12, 2018

Got it. That's fairly problematic. Thanks for letting me know.

@menghanl menghanl added the Type: Feature New features or improvements in behavior label Mar 27, 2018
@menghanl menghanl added this to the 1.11 Release milestone Mar 27, 2018
lyuxuan pushed a commit to lyuxuan/grpc-go that referenced this pull request Apr 4, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Sep 26, 2018
@btc btc deleted the btc/stats++ branch July 18, 2020 17:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants