-
Notifications
You must be signed in to change notification settings - Fork 77
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
fix(backend): matching trigger span duration and trigger time durations #2740
fix(backend): matching trigger span duration and trigger time durations #2740
Conversation
…stspanduration-in-tracetest-trigger-span
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I would remove that very tiny function but it's not critical
timeDifference := span.EndTime.Sub(span.StartTime) | ||
return fmt.Sprintf("%d", int64(timeDifference)) | ||
timeDifference := timeDiff(span.StartTime, span.EndTime) | ||
return fmt.Sprintf("%d", durationInNanoseconds(timeDifference)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this durationInNanoseconds
needed? you need to follow an extra indirection that is only a single line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, you don't even need to cast to int, %d
can handle int64 correctly: https://go.dev/play/p/8Vth4PCiQyO
return fmt.Sprintf("%d", durationInNanoseconds(timeDifference)) | |
return fmt.Sprintf("%d", timeDifference.Nanoseconds()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoot sorry, I didn't see this. I'll add them in my next PR
* Adding initial APIs for the example * Adding code for payment-executor-api * Adding full example * Adding trace-based tests * Updating README * Apply suggestions from code review Co-authored-by: Adnan Rahić <[email protected]> * Adding documentation to the example * fix(backend): matching trigger span duration and trigger time durations (#2740) * fix(frontend): adding default value for data store connection types (#2742) * fix(backend): fixing response status code for grpc request (#2741) * feat: add upsert method and enable it for environments (#2746) * add upsert method and enable it for environments * handle error when getting entity * PR suggestions --------- Co-authored-by: Adnan Rahić <[email protected]> Co-authored-by: Oscar Reyes <[email protected]> Co-authored-by: Matheus Nogueira <[email protected]>
* Adding initial APIs for the example * Adding code for payment-executor-api * Adding full example * Adding trace-based tests * Updating README * Apply suggestions from code review Co-authored-by: Adnan Rahić <[email protected]> * Adding documentation to the example * fix(backend): matching trigger span duration and trigger time durations (#2740) * fix(frontend): adding default value for data store connection types (#2742) * fix(backend): fixing response status code for grpc request (#2741) * feat: add upsert method and enable it for environments (#2746) * add upsert method and enable it for environments * handle error when getting entity * PR suggestions --------- Co-authored-by: Adnan Rahić <[email protected]> Co-authored-by: Oscar Reyes <[email protected]> Co-authored-by: Matheus Nogueira <[email protected]>
* Adding initial APIs for the example * Adding code for payment-executor-api * Adding full example * Adding trace-based tests * Updating README * Apply suggestions from code review Co-authored-by: Adnan Rahić <[email protected]> * Adding documentation to the example * fix(backend): matching trigger span duration and trigger time durations (#2740) * fix(frontend): adding default value for data store connection types (#2742) * fix(backend): fixing response status code for grpc request (#2741) * feat: add upsert method and enable it for environments (#2746) * add upsert method and enable it for environments * handle error when getting entity * PR suggestions --------- Co-authored-by: Adnan Rahić <[email protected]> Co-authored-by: Oscar Reyes <[email protected]> Co-authored-by: Matheus Nogueira <[email protected]>
This PR fixes the trigger trace span duration calculation to have the same value as the test run trigger duration
Changes
startTime
andendTime
to use the same value as the test run trigger timeFixes
Checklist
https://www.loom.com/share/1e0dac6d5af94a1ebeca443863fa5677