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

Stats updater uses wrong timestamps #3895

Closed
iefremov opened this issue Mar 26, 2019 · 4 comments · Fixed by brave/brave-core#2112
Closed

Stats updater uses wrong timestamps #3895

iefremov opened this issue Mar 26, 2019 · 4 comments · Fixed by brave/brave-core#2112

Comments

@iefremov
Copy link
Contributor

https://github.com/brave/brave-core/blob/master/browser/brave_stats_updater_params.cc#L17

Here we cache base::Time::Now() on startup and then use it in all outgoing pings. This way, all stats updater pings contain the same timestamp until the browser restart.

It would be more precise to take the actual Now() every time.

Brave | 0.64.2 Chromium: 73.0.3683.75 (Developer Build) (64-bit)

@iefremov
Copy link
Contributor Author

@bbondy @too4words @aekeus JFYI

@iefremov
Copy link
Contributor Author

Also there is a possible underflow: https://github.com/brave/brave-core/blob/master/browser/brave_stats_updater_params.cc#L98

(day_of_week can be zero if it is Sunday)

@emerick
Copy link
Contributor

emerick commented Mar 28, 2019

@btlechowski
Copy link

btlechowski commented Apr 1, 2019

Verification passed on

Brave 0.62.49 Chromium: 73.0.3683.86 (Official Build) (64-bit)
Revision f9b0bec6063ea50ce2b71f5b9abbae7beee319a6-refs/branch-heads/3683@{#858}
OS Windows 10 OS Build 17134.523

Used test plan from brave/brave-core#2112
Clean install ping on 2019-04-01
https://laptop-updates.brave.com/1/usage/brave-core?platform=winx64-bc&channel=release&version=0.62.49&daily=true&weekly=true&monthly=true&first=true&woi=2019-04-01&ref=none
Ping on 2019-04-02
https://laptop-updates.brave.com/1/usage/brave-core?platform=winx64-bc&channel=release&version=0.62.49&daily=true&weekly=false&monthly=false&first=false&woi=2019-04-01&ref=none

Verified passed with

Brave 0.62.49 Chromium: 73.0.3683.86 (Official Build) (64-bit)
Revision f9b0bec6063ea50ce2b71f5b9abbae7beee319a6-refs/branch-heads/3683@{#858}
OS Mac OS X

Initial ping:
[34560:775:0402/120420.690210:VERBOSE1:brave_stats_updater.cc(157)] Brave stats ping, url: https://laptop-updates.brave.com/1/usage/brave-core?platform=osx-bc&channel=release&version=0.62.49&daily=true&weekly=true&monthly=true&first=true&woi=2019-04-01&ref=none

"Next Day" ping:
[34639:775:0403/131315.015755:VERBOSE1:brave_stats_updater.cc(157)] Brave stats ping, url: https://laptop-updates.brave.com/1/usage/brave-core?platform=osx-bc&channel=release&version=0.62.49&daily=true&weekly=false&monthly=false&first=false&woi=2019-04-01&ref=none

Verification passed on

Brave 0.62.50 Chromium: 73.0.3683.86 (Official Build) (64-bit)
Revision f9b0bec6063ea50ce2b71f5b9abbae7beee319a6-refs/branch-heads/3683@{#858}
OS Linux

Initial ping:
[3985:3985:0403/124536.153928:VERBOSE1:brave_stats_updater.cc(157)] Brave stats ping, url: https://laptop-updates.brave.com/1/usage/brave-core?platform=linux-bc&channel=release&version=0.62.50&daily=true&weekly=true&monthly=true&first=true&woi=2019-04-01&ref=none

"Next Day" ping:

[4259:4259:0404/125741.418387:VERBOSE1:brave_stats_updater.cc(157)] Brave stats ping, url: https://laptop-updates.brave.com/1/usage/brave-core?platform=linux-bc&channel=release&version=0.62.50&daily=true&weekly=false&monthly=false&first=false&woi=2019-04-01&ref=none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants