Skip to content

Commit

Permalink
Merge pull request #63 from Parsely/issue/61-use-milliseconds-for-ts-tt
Browse files Browse the repository at this point in the history
  • Loading branch information
wzieba committed Sep 8, 2023
2 parents 370edb6 + 98691ae commit d2d5cd9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ private Map<String, Object> buildEvent(
data.put("manufacturer", this.deviceInfo.get("manufacturer"));
data.put("os", this.deviceInfo.get("os"));
data.put("os_version", this.deviceInfo.get("os_version"));
data.put("ts", now.getTimeInMillis() / 1000);
data.put("ts", now.getTimeInMillis());
data.put("parsely_site_uuid", this.deviceInfo.get("parsely_site_uuid"));
event.put("data", data);

Expand Down Expand Up @@ -896,14 +896,14 @@ private void doEnqueue(long scheduledExecutionTime) {
Map<String, Object> baseEventData = (Map<String, Object>) event.get("data");
assert baseEventData != null;
Map<String, Object> data = new HashMap<>((Map<String, Object>) baseEventData);
data.put("ts", now.getTimeInMillis() / 1000);
data.put("ts", now.getTimeInMillis());
event.put("data", data);

// Adjust inc by execution time in case we're late or early.
long executionDiff = (System.currentTimeMillis() - scheduledExecutionTime);
long inc = (this.latestDelayMillis + executionDiff) / 1000;
long inc = (this.latestDelayMillis + executionDiff);
this.totalTime += inc;
event.put("inc", inc);
event.put("inc", inc / 1000);
event.put("tt", this.totalTime);

enqueueEvent(event);
Expand Down

0 comments on commit d2d5cd9

Please sign in to comment.