Open oli-obk opened 4 years ago
Thanks for opening this!
I did not realize all timings are from the start of the current span. I thought they were from the start of the program 🤦
No worries! I think this is also doable by borrowing the implementation of tracing_subscriber::fmt::time::Uptime
. The "start" can be stored as a field in the layer. I would expect that the time between the the creation of the layer and the first event would be pretty short, thankfully.
Though I'm now also wondering if the start of a span should also have a timing printed, basically giving the time from the start of its parent span.
I think I experimented with this a while ago, but I didn't find it to be particularly useful because I've noticed in the codebases I'm responsible for, there's virtually no delay between creating and entering a span. I'm open to be convinced on this, especially if Chalk/rustc/Miri have different span creation patterns.
I think I experimented with this a while ago, but I didn't find it to be particularly useful because I've noticed in the codebases I'm responsible for, there's virtually no delay between creating and entering a span. I'm open to be convinced on this, especially if Chalk/rustc/Miri have different span creation patterns.
Ah, that's not what I meant. I meant printing the time within the parent span. So if we enter a span, that span entering has currently no time offset to the parent, but every event in the parent would have had one. If there was a long time since the last event in the parent span, the information when the new span was entered relative to it may be of interest to the users.
I did not realize all timings are from the start of the current span. I thought they were from the start of the program :facepalm:
Ok, this seems easy enough to do. Though I'm now also wondering if the start of a span should also have a timing printed, basically giving the time from the start of its parent span.