Skip to content

Commit

Permalink
Merge pull request #954 from bugsnag/PLAT-5192/breadcrumb-time-precision
Browse files Browse the repository at this point in the history
Increase breadcrumb time precision to milliseconds
  • Loading branch information
fractalwrench authored Oct 20, 2020
2 parents c0326a6 + d9f48d3 commit 649ebce
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 20 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## TBD

### Bug fixes

* Increase breadcrumb time precision to milliseconds
[#954](https://github.com/bugsnag/bugsnag-android/pull/954)

## 5.2.2 (2020-10-19)

### Bug fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class DateUtils {
@Override
protected DateFormat initialValue() {
TimeZone tz = TimeZone.getTimeZone("UTC");
DateFormat iso8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US);
DateFormat iso8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US);
iso8601.setTimeZone(tz);
return iso8601;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"timestamp": "1970-01-01T00:00:00Z",
"timestamp": "1970-01-01T00:00:00.000Z",
"name": "helloworld",
"type": "manual",
"metaData": {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"timestamp": "1970-01-01T00:00:00Z",
"timestamp": "1970-01-01T00:00:00.000Z",
"name": "metadata",
"type": "process",
"metaData": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"timestamp": "1970-01-01T00:00:00Z",
"timestamp": "1970-01-01T00:00:00.000Z",
"name": "helloworld",
"type": "manual",
"metaData": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"freeDisk": 120935100007,
"freeMemory": 2234092234234,
"orientation": "landscape",
"time": "1970-01-01T00:00:00Z"
"time": "1970-01-01T00:00:00.000Z"
}
4 changes: 2 additions & 2 deletions bugsnag-android-core/src/test/resources/event_redaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
"freeDisk": 22234423124,
"freeMemory": 92340255592,
"orientation": "portrait",
"time": "1970-01-01T00:00:00Z"
"time": "1970-01-01T00:00:00.000Z"
},
"breadcrumbs": [
{
"timestamp": "1970-01-01T00:00:00Z",
"timestamp": "1970-01-01T00:00:00.000Z",
"name": "Whoops",
"type": "log",
"metaData": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"freeDisk": 22234423124,
"freeMemory": 92340255592,
"orientation": "portrait",
"time": "1970-01-01T00:00:00Z"
"time": "1970-01-01T00:00:00.000Z"
},
"breadcrumbs": [],
"threads": []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"freeDisk": 22234423124,
"freeMemory": 92340255592,
"orientation": "portrait",
"time": "1970-01-01T00:00:00Z"
"time": "1970-01-01T00:00:00.000Z"
},
"breadcrumbs": [],
"threads": []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"freeDisk": 22234423124,
"freeMemory": 92340255592,
"orientation": "portrait",
"time": "1970-01-01T00:00:00Z"
"time": "1970-01-01T00:00:00.000Z"
},
"breadcrumbs": [],
"groupingHash": "herpderp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"freeDisk": 22234423124,
"freeMemory": 92340255592,
"orientation": "portrait",
"time": "1970-01-01T00:00:00Z"
"time": "1970-01-01T00:00:00.000Z"
},
"breadcrumbs": [],
"threads": []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
"freeDisk": 22234423124,
"freeMemory": 92340255592,
"orientation": "portrait",
"time": "1970-01-01T00:00:00Z"
"time": "1970-01-01T00:00:00.000Z"
},
"breadcrumbs": [],
"threads": [],
"session": {
"id": "123",
"startedAt": "1970-01-01T00:00:00Z",
"startedAt": "1970-01-01T00:00:00.000Z",
"events": {
"handled": 0,
"unhandled": 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"freeDisk": 22234423124,
"freeMemory": 92340255592,
"orientation": "portrait",
"time": "1970-01-01T00:00:00Z"
"time": "1970-01-01T00:00:00.000Z"
},
"breadcrumbs": [],
"threads": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
"freeDisk": 22234423124,
"freeMemory": 92340255592,
"orientation": "portrait",
"time": "1970-01-01T00:00:00Z"
"time": "1970-01-01T00:00:00.000Z"
},
"breadcrumbs": [
{
"timestamp": "1970-01-01T00:00:00Z",
"timestamp": "1970-01-01T00:00:00.000Z",
"name": "helloworld",
"type": "manual",
"metaData": {}
Expand Down
2 changes: 1 addition & 1 deletion bugsnag-android-core/src/test/resources/json_stream.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"long": 123,
"float": 123.45,
"streamable": {
"timestamp": "1970-01-01T00:00:00Z",
"timestamp": "1970-01-01T00:00:00.000Z",
"name": "whoops",
"type": "log",
"metaData": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"sessions": [
{
"id": "123",
"startedAt": "1970-01-01T00:00:00Z",
"startedAt": "1970-01-01T00:00:00.000Z",
"user": {}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void setup() {
public void serialize() {
Map<String, Object> map = new HashMap<>();
new BreadcrumbSerializer().serialize(map, crumb);
assertEquals("1970-01-01T00:00:00Z", map.get("timestamp"));
assertEquals("1970-01-01T00:00:00.000Z", map.get("timestamp"));
assertEquals("Whoops", map.get("message"));
assertEquals("state", map.get("type"));
assertEquals(metadata, map.get("metadata"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void serialize() {
assertEquals(20923423434L, map.get("freeDisk"));
assertEquals(23409662345L, map.get("freeMemory"));
assertEquals("portrait", map.get("orientation"));
assertEquals("1970-01-01T00:00:00Z", map.get("time"));
assertEquals("1970-01-01T00:00:00.000Z", map.get("time"));

Map<String, Object> runtimeVersions = new HashMap<>();
runtimeVersions.put("androidApiLevel", 27);
Expand Down

0 comments on commit 649ebce

Please sign in to comment.