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

Perform stats ping immediately on startup #2188

Closed
emerick opened this issue Nov 19, 2018 · 3 comments · Fixed by brave/brave-core#930
Closed

Perform stats ping immediately on startup #2188

emerick opened this issue Nov 19, 2018 · 3 comments · Fixed by brave/brave-core#930

Comments

@emerick
Copy link
Contributor

emerick commented Nov 19, 2018

Description

We ping the stats server once an hour while the browser is running, but we must also ping the server immediately upon startup as well. In addition, this startup ping should occur 3 seconds after startup to match the timing of our referral initialization ping.

Steps to Reproduce

  1. Start Brave.
  2. Start a network analyzer, such as Fiddler on Windows. (or use --enable-logging --v=1)
  3. Wait for more than 2 minutes (this was the original expected time of the startup ping).

Actual result:

No ping is sent to https://laptop-updates.brave.com/1/usage/brave-core until a full hour elapses.

Expected result:

A ping such as the following is sent to the stats server:

GET https://laptop-updates.brave.com/1/usage/brave-core?platform=winx64-bc&channel=release&version=0.59.1&daily=false&weekly=false&monthly=false&first=false&woi=2018-11-19&ref=none HTTP/1.1
Host: laptop-updates.brave.com
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.44 Safari/537.36
Accept-Encoding: gzip, deflate, br

Reproduces how often:

Every time.

@kjozwiak
Copy link
Member

@emerick when running Brave using --enable-logging --v=1, noticed the following stats ping:

[17428:775:1128/210809.765356:VERBOSE1:brave_stats_updater.cc(145)] Brave stats ping, url: https://laptop-updates.brave.com/1/usage/brave-core?platform=osx-bc&channel=beta&version=0.57.8&daily=false&weekly=false&monthly=false&first=false&woi=2018-11-26&ref=none

Wasn't using a referral installation hence ref=none, but is this the ping that we're looking for in the logs?

@emerick
Copy link
Contributor Author

emerick commented Nov 29, 2018

Yes, exactly!

@kjozwiak
Copy link
Member

kjozwiak commented Nov 29, 2018

Went through verification using the following build under macOS 10.14 x64 - PASSED

Brave 0.57.8 Chromium: 71.0.3578.53 (Official Build) beta(64-bit)
Revision 599fb72e740eab9d10609f1ed28a2ad669f82c1a-refs/branch-heads/3578@{#669}
OS Mac OS X

Ensured that the ping was being sent at startup with and without referrals:

[18000:775:1129/005140.612053:VERBOSE1:brave_stats_updater.cc(145)] Brave stats ping, url: https://laptop-updates.brave.com/1/usage/brave-core?platform=osx-bc&channel=beta&version=0.57.8&daily=true&weekly=true&monthly=true&first=true&woi=2018-11-26&ref=RED194

[18057:775:1129/005942.339776:VERBOSE1:brave_stats_updater.cc(145)] Brave stats ping, url: https://laptop-updates.brave.com/1/usage/brave-core?platform=osx-bc&channel=beta&version=0.57.8&daily=true&weekly=true&monthly=true&first=true&woi=2018-11-26&ref=KJO527

[18279:775:1129/013510.983662:VERBOSE1:brave_stats_updater.cc(145)] Brave stats ping, url: https://laptop-updates.brave.com/1/usage/brave-core?platform=osx-bc&channel=beta&version=0.57.8&daily=true&weekly=true&monthly=true&first=true&woi=2018-11-26&ref=none

Verification PASSED on

Brave 0.57.8 Chromium: 71.0.3578.53 (Official Build) beta(64-bit)
Revision 599fb72e740eab9d10609f1ed28a2ad669f82c1a-refs/branch-heads/3578@{#669}
OS Windows 7

[12476:8756:1129/200605.120:VERBOSE1:network_delegate.cc(32)] NetworkDelegate::NotifyBeforeURLRequest: https://laptop-updates.brave.com/1/usage/brave-core?platform=winx64-bc&channel=beta&version=0.57.8&daily=true&weekly=true&monthly=true&first=true&woi=2018-11-26&ref=none

Verification PASSED on Ubuntu 17.10 x64

Brave 0.57.8 Chromium: 71.0.3578.53 (Official Build) beta(64-bit)
Revision 599fb72e740eab9d10609f1ed28a2ad669f82c1a-refs/branch-heads/3578@{#669}
OS Linux
[10335:10335:1130/001854.563533:VERBOSE1:brave_stats_updater.cc(145)] Brave stats ping, url: https://laptop-updates.brave.com/1/usage/brave-core?platform=linux-bc&channel=beta&version=0.57.8&daily=true&weekly=true&monthly=true&first=true&woi=2018-11-26&ref=none

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