Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Add week number to telemetry report #1266

Merged
merged 3 commits into from
Oct 30, 2019

Conversation

frangio
Copy link
Contributor

@frangio frangio commented Oct 25, 2019

Fixes #1260

@frangio frangio requested a review from spalladino October 25, 2019 23:05
@@ -21,6 +21,8 @@ interface Arguments {
}

process.once('message', async function({ uuid, commandData }: Arguments) {
const unixWeek = Math.floor(Date.now() / (1000 * 60 * 60 * 24 * 7));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • How reliable is this calculation? How much offset would we end up with in a few months time?
  • How easy will it be to visualize later? Should we aim to label these as YYYY-WW instead, for readability? Or is it easy to generate this from the unixWeek value from firebase?

Copy link
Contributor Author

@frangio frangio Oct 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand the question about reliability or offset. 🤔 Do you mean because of leap seconds, or floating point errors, or...? Leap seconds should not affect this because they're accounted for in Unix time. This should precisely represent any week.

For visualization we had to convert back to a datetime in the BigQuery SQL code: TIMESTAMP_SECONDS(unixWeek * 7 * 24 * 60 * 60). This worked fine, but it may be simpler to do if we store them as YYYY-WW or even YYYY-MM-DD. It really depends on what will be easier to do in an SQL query. I would have to read more about it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I think of it, using Unix weeks instead of calendar weeks would be more accurate for statistical purposes (since we don't have longer and shorter weeks), so let's go with that!

@spalladino
Copy link
Contributor

I think this may be needing a merge due to the failing test in the CI

@spalladino spalladino added the status:ready-to-merge Order mergify to merge label Oct 29, 2019
@frangio
Copy link
Contributor Author

frangio commented Oct 29, 2019

🙌 Thanks for reviewing!

@spalladino spalladino merged commit 3a7c51e into OpenZeppelin:master Oct 30, 2019
@frangio frangio deleted the telemetry-week branch October 30, 2019 16:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:ready-to-merge Order mergify to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add dates to telemetry reports
2 participants