-
Notifications
You must be signed in to change notification settings - Fork 109
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
Track time spent in each wasm instance env call #427
Conversation
@@ -0,0 +1,69 @@ | |||
use std::time::{Duration, Instant}; |
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 span stuff is rough and ready, happy to do whatever with it once we agree this is all the right direction.
} | ||
|
||
/// Call the function `f` with the name `func`. | ||
/// The function `f` is provided with the callers environment and the host's memory. | ||
/// | ||
/// One of `cvt`, `cvt_ret`, or `cvt_noret` should be used in the implementation of any |
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 do you think of this structure?
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.
This seems like an improvement; I'm a fan.
e0e5a29
to
064564d
Compare
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.
This looks good. I've left a few doc/comment related comments and suggestions, but I think the code itself is ready for the big time.
log::debug!( | ||
"Long running reducer {func_ident:?} took {:?} to execute, with the following wasm_instance_env call times: {:?}", | ||
timings.total_duration, | ||
timings.wasm_instance_env_call_times | ||
); |
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.
Ideally I think we should change this message so that it only tries to print the wasm_instance_env_call_times
if we're collecting that data. I'm not concerned about that; maybe just a TODO comment?
} | ||
|
||
/// Call the function `f` with the name `func`. | ||
/// The function `f` is provided with the callers environment and the host's memory. | ||
/// | ||
/// One of `cvt`, `cvt_ret`, or `cvt_noret` should be used in the implementation of any |
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.
This seems like an improvement; I'm a fan.
Additionally, this further tidies the interface between the host and the wasm instance env. In particular, reducer calls are explicitly started and stopped, and the wasm instance env becomes responsible for its own instrumentation.
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io> Signed-off-by: George Kulakowski <george.kulakowski@gmail.com>
6adcb3a
to
afff6e8
Compare
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io> Signed-off-by: George Kulakowski <george.kulakowski@gmail.com>
Additionally, this further tidies the interface between the host and the wasm instance env. In particular, reducer calls are explicitly started and stopped, and the wasm instance env becomes responsible for its own instrumentation.
Description of Changes
API and ABI
If the API is breaking, please state below what will break
Expected complexity level and risk
2: This moderately changes some of the plumbing between the host and instance.
How complicated do you think these changes are? Grade on a scale from 1 to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex change.
This complexity rating applies not only to the complexity apparent in the diff,
but also to its interactions with existing and future code.
If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning ways.