timed icon indicating copy to clipboard operation
timed copied to clipboard

Enrich / Customize / Override the function name

Open y2kappa opened this issue 5 years ago • 0 comments

A lot of functions are called new and they can be expensive, like getting a network db handle. it's very unclear what happens when a lot of news appear in your flamegraph.

For that there are 2 options that I see:

  1. Allow overriding from the derive attributes
#[timed::timed(printer = "info!", tracing=true, name="whatever")]
  1. Also (not exclusive to the above), add full module path to this. instead of recording it as "new", record it as "foo::bar::new". There is a macro for this, not sure if it works https://doc.rust-lang.org/std/macro.module_path.html

y2kappa avatar Oct 20 '20 00:10 y2kappa