Page MenuHomePhabricator

Test X-Analytics tag in production
Closed, ResolvedPublic

Description

Background

In T212961: Add X-Analytics tag for AMC webrequests, we created the tag for AMC and added it to the x-analytics header. We tested that the header appears in index.php using devtools. We would like to confirm that the header works on production by testing it directly in the webrequest table

Query

From @Tbayer's comment in T212961#5022398:

SELECT DISTINCT x_analytics_map['mf-m'] AS values FROM wmf.webrequest WHERE year = 2019 AND month = 3 AND day = 12 AND hour = 0;

OK
values
NULL
b
Time taken: 26.1 seconds, Fetched: 2 row(s)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 14 2019, 10:54 AM
ovasileva triaged this task as High priority.

adding RW Test Cases tag, but noting that we should expand on the test case here.

Tbayer moved this task from Triage to Next Up on the Product-Analytics board.

The tag is present in the webrequest table (as "b%2Camc", an unencoded "b,amc" would have been slightly more aesthetically pleasing, but it's not a dealbreaker ;) It occurs on exactly the three projects where we expect it after the recent deployment. Will do some further checks.

SELECT x_analytics_map['mf-m'], COUNT(*) AS requests 
FROM wmf.webrequest WHERE year = 2019 AND month = 4 AND day = 3 AND hour = 0 
GROUP BY x_analytics_map['mf-m'];
_c0	requests
NULL	291486451
b	4528
b%2Camc	6

SELECT uri_host, COUNT(*) AS requests 
FROM wmf.webrequest WHERE year = 2019 AND month = 4 AND day = 3 
AND x_analytics_map['mf-m'] = 'b%2Camc'
GROUP BY uri_host
ORDER BY requests DESC LIMIT 100;

uri_host	requests
es.m.wikipedia.org	1107
ar.m.wikipedia.org	643
id.m.wikipedia.org	62
Time taken: 146.209 seconds, Fetched: 3 row(s)
Tbayer closed this task as Resolved.Apr 6 2019, 1:53 AM

Two further plausibility checks look fine as well:

  • The distribution of special pages viewed seems roughly plausible (even if we perhaps don't anticipate MassMessage or CX to be widely used under the AMC interface).
  • Almost all request are logged-in.
SELECT x_analytics_map['special'] AS specialpagename, COUNT(*) AS requests 
FROM wmf.webrequest WHERE year = 2019 AND month = 4 AND day <= 4
AND x_analytics_map['mf-m'] = 'b%2Camc'
AND namespace_id = -1
GROUP BY x_analytics_map['special'] ORDER BY requests DESC LIMIT 50;

specialpagename	requests
MobileDiff	491
History	199
MobileOptions	160
Contributions	120
Search	118
Watchlist	89
EditWatchlist	58
MobileMenu	55
Notifications	31
Newpages	31
Nearby	21
Userlogout	20
Uploads	18
Log	13
Preferences	8
Userlogin	6
CreateAccount	6
GlobalPreferences	5
Prefixindex	4
MobileLanguages	3
ValidationStatistics	3
ContentTranslation	3
Userrights	2
Upload	2
Tags	1
MassMessage	1
Listusers	1
BlockList	1
Recentchanges	1
Confirmemail	1
Time taken: 578.379 seconds, Fetched: 30 row(s)


SELECT x_analytics_map['loggedIn'], COUNT(*) AS requests 
FROM wmf.webrequest WHERE year = 2019 AND month = 4 AND day = 4
AND x_analytics_map['mf-m'] = 'b%2Camc'
GROUP BY x_analytics_map['loggedIn'];

_c0	requests
NULL	4
1	928
Time taken: 121.527 seconds, Fetched: 2 row(s)