Page MenuHomePhabricator

Special:CXStats for Last week is wrong for guwiki
Closed, ResolvedPublic

Details

Related Gerrit Patches:
mediawiki/extensions/ContentTranslation : masterUse mode 3 for YEARWEEK
mediawiki/extensions/ContentTranslation : masterMake our date manipulation to handle timezones consistently

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 15 2017, 1:54 PM

Change 337875 had a related patch set uploaded (by Nikerabbit):
Make our date manipulation to handle timezones consistently

https://gerrit.wikimedia.org/r/337875

Nikerabbit triaged this task as Low priority.Feb 20 2017, 12:32 PM

@dchan Can you please look at this some time? Thanks.

Change 337875 merged by jenkins-bot:
Make our date manipulation to handle timezones consistently

https://gerrit.wikimedia.org/r/337875

KartikMistry moved this task from QA to Done on the Language-2017 Sprint 3 board.Mar 1 2017, 6:39 AM
Arrbee moved this task from Done to QA on the Language-2017 Sprint 3 board.Mar 1 2017, 7:06 AM

Hmm, I might have made the problem worse (unless we really have multiple week gaps in our data):

Old code on the left, new code on the right.

There is some horizontal movement due to sun-mon vs. mon-sun that I fixed, but also other weird patterns. Should look more closely what is going.

Arrbee moved this task from QA to In Progress on the Language-2017 Sprint 3 board.Mar 3 2017, 7:01 AM

Based on Santhosh' query there are no gaps in the data in the database.

This is what API returns:

{count: 157512, delta: 2663, date: "2017-01-01"}
{count: 157512, delta: 0, date: "2017-01-08"}
{count: 163292, delta: 2936, date: "2017-01-15"}
{count: 163292, delta: 0, date: "2017-01-22"}
{count: 165705, delta: 2413, date: "2017-01-29"}

This is what $x = ContentTranslation\Translation::getTrendByStatus( null, null, 'published', 'month', null ); returns:

[1482624000]=> 2016-12-25
  ["count"]=>    int(151915)
  ["delta"]=>    int(2296)
[1483228800]=> 2017-01-01
  ["count"]=>    int(157512)
  ["delta"]=>    int(2663)
[1484438400]=> 2017-01-15
  ["count"]=>    int(163292)
  ["delta"]=>    int(2936)
[1485648000]=> 2017-01-20
  ["count"]=>    int(165705)
  ["delta"]=>    int(2413)
[1486252800]=> 2017-02-05
  ["count"]=>    int(168055)
  ["delta"]=>    int(2350)

The above is before we call ApiQueryContentTranslationLanguageTrend::addMissingDates, which obviously adds the empty things for the missing weeks. So bug seems to be in getTrendByStatus.

Change 340933 had a related patch set uploaded (by nikerabbit):
[mediawiki/extensions/ContentTranslation] Use mode 3 for YEARWEEK

https://gerrit.wikimedia.org/r/340933

Change 340933 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation] Use mode 3 for YEARWEEK

https://gerrit.wikimedia.org/r/340933

Nikerabbit removed a project: Patch-For-Review.
Arrbee moved this task from QA to Done on the Language-2017 Sprint 3 board.Mar 7 2017, 6:48 AM

The global weekly numbers in https://test.wikipedia.org/wiki/Special:ContentTranslationStats look fine now, no gaps at all.

The original problem has been solved, but there is a new bug about broken dashboard user stats at: https://phabricator.wikimedia.org/T160391

KartikMistry closed this task as Resolved.Mar 14 2017, 10:49 AM