Page MenuHomePhabricator

Add x-analytics header for page view and preview requests
Closed, ResolvedPublic1 Estimated Story Points

Description

In the Android app, add x-analytics request header with value pageview=1 for both RESTBase and MediaWiki php.api endpoints.
(Might as well add the missing preview=1 values to the link preview requests.)

Event Timeline

https://gerrit.wikimedia.org/r/#/c/274645/ has already been merged (before I split this off into this subtask).

@bearND nice, thanks. We should estimate this before the prioritization part of our meeting today. Does it belong in Code Review?

MBinder_WMF set the point value for this task to 1.

QA: no visible changes expected. This is just for Analytics.

Editing Test Wiki page does not save changes.

Looks good. Exploratory testing did not cover additional issues beyond the editing issue.

Did we test that indeed preview=1/pageview=1 is being sent and appears in cluster with a test build of the app? cc @Tbayer

Repeating the test query that @madhuvishy did last October, it seems that no preview=1 headers have been received yet:

hive (default)> select is_pageview, x_analytics_map["preview"] from wmf.webrequest where year=2016 and month=3 and x_analytics_map["preview"] is not NULL limit 10;
...
OK
is_pageview	_c1
Time taken: 4671.623 seconds

Repeating the test query that @madhuvishy did last October, it seems that no preview=1 headers have been received yet:

hive (default)> select is_pageview, x_analytics_map["preview"] from wmf.webrequest where year=2016 and month=3 and x_analytics_map["preview"] is not NULL limit 10;
...
OK
is_pageview	_c1
Time taken: 4671.623 seconds

@Tbayer and @madhuvishy: just a small nit: if you expected that query to return results, then the limit 10 would be enough to ensure good use of resources. But if you're not sure, I would've looked at a single day instead of a month, like where ... and day=2. I know March is just getting started but still, there's a lot of data in webrequest and I think we should avoid any unnecessary work for the cluster.

FYI that no preview header was being sent, changes to that effect have just been committed recently.

Repeating the test query that @madhuvishy did last October, it seems that no preview=1 headers have been received yet:

hive (default)> select is_pageview, x_analytics_map["preview"] from wmf.webrequest where year=2016 and month=3 and x_analytics_map["preview"] is not NULL limit 10;
...
OK
is_pageview	_c1
Time taken: 4671.623 seconds

@Tbayer and @madhuvishy: just a small nit: if you expected that query to return results, then the limit 10 would be enough to ensure good use of resources. But if you're not sure, I would've looked at a single day instead of a month, like where ... and day=2. I know March is just getting started but still, there's a lot of data in webrequest and I think we should avoid any unnecessary work for the cluster.

Actually this change is not live in production yet, so we are looking for some isolated test views done by the developers and testers, and it wasn't certain on which day these would have happened (https://gerrit.wikimedia.org/r/#/c/274645/ was merged on March 3).

got it, sorry then, @Tbayer, I jumped to conclusions.