Skip to content

Conversation

Aaron1011
Copy link
Contributor

This makes it easier to record events when the Profiler and the
TimingGuard would need to be stored different structs.

This makes it easier to record events when the `Profiler` and the
`TimingGuard` would need to be stored different structs.
thread_id: timing.thread_id,
start_count: timing.start_count,
});
}
Copy link
Member

Choose a reason for hiding this comment

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

Would

let start_count = profiler.counter.since_start();
// some work
let raw_event = RawEvent::new_interval(
    event_kind,
    event_id,
    thread_id,
    start_count,
    profiler.counter.since_start(),
);
profiler.record_raw_event(&raw_event);

work if you make profiler.counter.since_start() public? That is what the drop impl of TimingGuard does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would, but I think this API is more consistent with the existing one (hiding the underlying counter). I don't have a strong opinion, though.

@Aaron1011
Copy link
Contributor Author

@wesleywiser I've addressed your comments

Copy link
Member

@wesleywiser wesleywiser left a comment

Choose a reason for hiding this comment

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

Thanks @Aaron1011!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants