Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Calculate all children span start times using the monotonic clock #508

Open
rakyll opened this issue Mar 1, 2018 · 1 comment
Open

Calculate all children span start times using the monotonic clock #508

rakyll opened this issue Mar 1, 2018 · 1 comment

Comments

@rakyll
Copy link
Contributor

rakyll commented Mar 1, 2018

We initially made an improvement to calculate the span duration from the monotonic clock.

We also have to make sure that children start times are calculated with the monotonic clock to have a more precise overview of a trace.

@rakyll rakyll added the trace label Mar 1, 2018
odeke-em added a commit to orijtech/opencensus-go that referenced this issue Mar 1, 2018
Fixes census-instrumentation#506

We added a monotonic time calculation but without
much context as to why, so by just looking at the code
the calculation seemed unnecessary but after a few
discussions and godoc readings, calculation of time
using the monotonic clock is achievable by subtractions
hence the startTime.Add(time.Now(startTime).
Extract that code into an internal helper for clarity
and since we'll be re-using that code later on, such as
for census-instrumentation#508
odeke-em added a commit to orijtech/opencensus-go that referenced this issue Mar 1, 2018
Fixes census-instrumentation#506

We added a monotonic time calculation but without
much context as to why, so by just looking at the code
the calculation seemed unnecessary but after a few
discussions and godoc readings, calculation of time
using the monotonic clock is achievable by subtractions
hence the startTime.Add(time.Now(startTime).
Extract that code into an internal helper for clarity
and since we'll be re-using that code later on, such as
for census-instrumentation#508
@odeke-em
Copy link
Member

odeke-em commented Mar 1, 2018

After #509 is merged, then we can easily work on this too.

odeke-em pushed a commit that referenced this issue Mar 2, 2018
* Add an internal utility MonotonicTimeSince

Fixes #506

We added a monotonic time calculation but without
much context as to why, so by just looking at the code
the calculation seemed unnecessary but after a few
discussions and godoc readings, calculation of time
using the monotonic clock is achievable by subtractions
hence the startTime.Add(time.Now(startTime).
Extract that code into an internal helper for clarity
and since we'll be re-using that code later on, such as
for #508

* Move MonotonicTime since comments out of body and up into godoc

Feedback from @rakyll in review.

* Change name to MonotonicEndTime

As per @Ramonza's review suggestion, since
the previous MonotonicTimeSince name suggests
it being a duration due to usage of Since
with alludes to time.Since.
@rakyll rakyll changed the title trace: calculate all children span start times using the monotonic clock Calculate all children span start times using the monotonic clock Mar 6, 2018
@odeke-em odeke-em self-assigned this Mar 13, 2018
@rghetia rghetia added the P1 label May 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants