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

flow.perf: Add auto-timer around existing Clock_types et al: a-la boost.timer. #67

Open
ygoldfeld opened this issue Mar 10, 2024 · 1 comment
Labels
enhancement New feature or request from-akamai-pre-open Issue origin is Akamai, before opening source

Comments

@ygoldfeld
Copy link
Contributor

Filed by @ygoldfeld pre-open-source:

An easy utility for casual timing (conceptually just like https://www.boost.org/doc/libs/1_77_0/libs/timer/doc/index.html):

{
  flow::perf::Auto_timer t(logger, flow::log::Sev::S_INFO, "op name", <a Clock_types_subset>);
  // ...do stuff, possibly break out of {} early, whatever...
}
// When block exits, t dtor runs and logs, in the Checkpointing_timer style, the total duration results. Use minimal timing to cut overhead completely: Checkpointing_timer::now() 2x. No need to use a Checkpointing_timer object since always just 1 checkpoint.

Could also use it in Flow-IPC's perf_demo if useful there.

@ygoldfeld ygoldfeld added enhancement New feature or request from-akamai-pre-open Issue origin is Akamai, before opening source labels Mar 10, 2024
@ygoldfeld
Copy link
Contributor Author

Note - boost.timer (linked in description) may well be sufficient and has its own knobs and whatever. This one has synergy with flow.perf and flow.log, basically rounding out its capabilities with Checkpointing_timer machinery at the core (and logging via flow.log). A value-add if you will.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request from-akamai-pre-open Issue origin is Akamai, before opening source
Projects
None yet
Development

No branches or pull requests

1 participant