Use float instead of Date for protocol types for higher precision.#1737
Use float instead of Date for protocol types for higher precision.#1737maciejwalkowiak merged 9 commits into6.x.xfrom
float instead of Date for protocol types for higher precision.#1737Conversation
Codecov Report
@@ Coverage Diff @@
## 6.x.x #1737 +/- ##
============================================
+ Coverage 80.93% 80.98% +0.05%
- Complexity 2822 2835 +13
============================================
Files 205 205
Lines 10360 10405 +45
Branches 1370 1376 +6
============================================
+ Hits 8385 8427 +42
Misses 1493 1493
- Partials 482 485 +3
Continue to review full report at Codecov.
|
bruno-garcia
left a comment
There was a problem hiding this comment.
Looks so much better in the UI 💯
|
btw:
that means when the device is in sleep mode, the system does not increase the timer, is it possible that it'd cause off-by-1 sort of problems? https://developer.android.com/reference/android/os/SystemClock search for |
sentry/src/main/java/io/sentry/adapters/DoubleDeserializerAdapter.java
Outdated
Show resolved
Hide resolved
sentry/src/main/java/io/sentry/adapters/DoubleSerializerAdapter.java
Outdated
Show resolved
Hide resolved
Are our transactions meant to span over the system sleep? If so, we should at least check if the |
good question and I don't know the answer right now, have to check if it makes sense or not |
|
should we target the v6 branch then? |
|
Yes but this PR is anyway on hold until we have JSON serialization merged. |
|
JSON PR is getting to its final form so might be time to point this to that branch and merge? |
|
Just to avoid double work - once JSON PR is merged to |
|
Gson PR merged into branch |
|
6.x.x is now up to date with main, this PR is now pointing to 6.x.x. Ready for the final review. |
|
@romtsn would you like to have a look? |
|
@marandaneto checking 👍 |
📜 Description
Use
floatinstead ofDatefor protocol types for higher precision.To retrieve more precise timestamps, we are using
System#nanoTimeas it's the only method available both on Android and JVM.When Span is created with given start timestamp (for example with Android app start time), we are not able to measure high precision timestamp, we fall back then to regular timestamp with milliseconds precision.
How it looks in UI:

💡 Motivation and Context
Fixes #1689
💚 How did you test it?
Unit & integration tests.
📝 Checklist