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

sometimes event duration is < 0 #249

Closed
JamieDanielson opened this issue Sep 27, 2023 · 1 comment · Fixed by #258
Closed

sometimes event duration is < 0 #249

JamieDanielson opened this issue Sep 27, 2023 · 1 comment · Fixed by #258
Assignees
Labels
type: bug Something isn't working

Comments

@JamieDanielson
Copy link
Contributor

          Should we add an extra check in here for other goofiness like request timestamp being greater than response timestamp? Something like `if eventDuration < 0 { eventDuration = 0 }`

Originally posted by @JamieDanielson in #179 (comment)

When a timestamp is missing it is still possible to get negative durations. Ideally we have a proper matching so this doesn't happen... but if it does, we should probably set duration to 0 to avoid skewing correct durations.

negativedurations

@JamieDanielson JamieDanielson added the type: bug Something isn't working label Sep 27, 2023
@JamieDanielson
Copy link
Contributor Author

If there is no timestamp for either request or response, we should not be setting duration at all because we have no way of knowing, and keeping it even at 0 will skew the data.

JamieDanielson added a commit that referenced this issue Oct 3, 2023
…#258)

## Which problem is this PR solving?

- Closes #249 

## Short description of the changes

- refactor duration computation into an extracted function
- test drive timestamp(s) set/unset scenarios

## How to verify that this has the expected result

Duration is only set if both timestamps are present. If one or both are
missing, attributes are added to the event indicating that, and no
duration is set (event timestamp is set to time.now). If both timestamps
are present, calculate the duration and add to the event. We should see
no more negative durations caused by missing timestamps

---------

Co-authored-by: Jamie Danielson <[email protected]>
Co-authored-by: JamieDanielson <[email protected]>
Co-authored-by: Mike Goldsmith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
2 participants