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

Add feature for measuring duration of arbitrary code #5

Open
loganek opened this issue May 9, 2018 · 4 comments
Open

Add feature for measuring duration of arbitrary code #5

loganek opened this issue May 9, 2018 · 4 comments
Labels
enhancement New feature or request

Comments

@loganek
Copy link
Member

loganek commented May 9, 2018

Currently we have a scoped tracepoint, which allows us to measure an time of executing the code:

{
  ht_feature_callstack_start_string(timeline, "label");
  // some code
  ht_feature_callstack_start_string_stop(timeline);
}

Unfortunately we can't measure time of code which is overlapping; e.g. we can't measure time for code1+code2 and code2+code3 at the same time using the same timeline:

// code1
// code2
// code3

We should design and implement timeline feature, which would allow us to measure time of any code; something like:

HT_DurationId id1 = ht_feature_duration_start(timeline);
// code1
HT_DurationId id2 = ht_feature_duration_start(timeline);
// code2
HT_DurationNs duration1 = ht_feature_duration_stop(timeline, id1);
// code3
HT_DurationNs duration2 = ht_feature_duration_stop(timeline, id2);
@loganek loganek added the enhancement New feature or request label May 9, 2018
@andrewrch
Copy link

I'm going to look in to this later today 👍

@loganek
Copy link
Member Author

loganek commented May 23, 2018

Hey @andrewrch any progress on that issue? :)

@andrewrch
Copy link

Hey 😊 I made a start on it on the train back on Tuesday. Started with the implementation of feature_callstack and worked from there. Getting some issues at the moment accessing events I put in a bag. Will spend a bit more time on it tonight/tomorrow and let you know if I need a hand.

@loganek
Copy link
Member Author

loganek commented May 24, 2018

Thanks for the update :) No rush, just wanted to know if you had a chance to look into this and if there's anything I could help you with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants