Skip to content
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

Improved metrics for updating application #5607

Merged
merged 4 commits into from
Jun 16, 2022

Conversation

jansav
Copy link
Contributor

@jansav jansav commented Jun 13, 2022

No description provided.

@jansav jansav added the enhancement New feature or request label Jun 13, 2022
@jansav jansav added this to the 5.6.0 milestone Jun 13, 2022
@jansav jansav requested a review from a team as a code owner June 13, 2022 10:07
@jansav jansav requested review from nevalla and jim-docker and removed request for a team June 13, 2022 10:07
@jansav jansav linked an issue Jun 13, 2022 that may be closed by this pull request
@jansav jansav force-pushed the feature/improved-metrics-for-updating-application branch from eef9344 to 58a322c Compare June 14, 2022 04:23
*/
import moment from "moment";

export const getCurrentDateTime = () => moment().utc().format();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this be an injectable, so that you don't to do global.Data.now = ... in the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to say yes, but previous experience says that it's best to override Date by messing with globals, because of the all of the libraries that use it. If we used injectable for it, then we would have absolute control in our code base, but if (and when) we use some library that uses Date.now, we will get separate opinion which is easy way encounter hard-to-debug failing unit tests.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fair enough, thought after talking with @nevalla it seems that the timestamp is received automatically, so we don't need to include it.

Copy link
Contributor Author

@jansav jansav Jun 16, 2022

Choose a reason for hiding this comment

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

I'd say let's keep it there. Sometimes it's easier to access data from event itself, and not from the metadata. It all depends from the choice of service that we are using.

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
@jansav jansav force-pushed the feature/improved-metrics-for-updating-application branch from 58a322c to 84fc925 Compare June 15, 2022 06:17
@Nokel81 Nokel81 merged commit 5c049ec into master Jun 16, 2022
@Nokel81 Nokel81 deleted the feature/improved-metrics-for-updating-application branch June 16, 2022 13:05
@Nokel81 Nokel81 mentioned this pull request Jun 17, 2022
@jansav jansav mentioned this pull request Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve metrics gathering for update checks
3 participants