Page MenuHomePhabricator

Pageviews Analysis 2026 (Vue + Codex)
Closed, ResolvedPublic

Description

Background

I've maintained Pageviews Analysis for a decade now. It is littered with bugs and is difficult to maintain. I've received a lot of interest from potential contributors, but in the end I think most people just find it too unorthodox of a codebase to contribute to. I even find myself reluctant to touch it because I know it will be a headache. It is essentially a glorified jQuery app and its age is showing.

The current implementation also chiefly relies on the clientside for processing, prohibiting us from any large-scale processing that requires more RAM. Not to mention the Massviews has an unnecessarily large memory footprint as it is.

Needless to say, I think it's time to rewrite this thing.

Goals

  • The clientside should be 100% Codex and Vue
  • Use any and all applicable MediaWiki conventions
  • Provide a backend API (preferably RESTful) for most or all functionality
  • Allow bulk processing, using a job queue (supersedes T157830)
  • Have full support from a WMF team

Where the code should live

MediaWiki

PageViewInfo exists and would seemingly be the right home for this.

Pros:

  • More likely to be co-maintained
  • Easier backend processing of categories and other MW-specific functionality
  • Robust job queue
  • Existing action API which can be extended
  • Allows us to embed the experience on the wiki (Special pages)
  • Possible integration into wikitext and Lua (parser functions, magic words, etc.)
  • Charts exist now in production and largely offer what we need.

Cons:

  • No WMF team ownership so it may be hard to get the new features reviewed and deployed
  • Possible difficulties conforming functionality to the agnostic PageViewService
Wikimedia Statistics

https://stats.wikimedia.org (Data-Engineering-Wikistats) is the official Wikimedia Stats tool.

Pros:

  • Consolidated with other official stats tooling
  • Already in production
  • Data Engineering team may be available to help

Cons:

  • No Codex or Vue (though supposedly this is slated to change?)
  • Unfamiliar codebase for most
  • May not be possible to have chart feature parity with what we're currently doing with Chart.js (?)
  • Unclear if there is a backend we could leverage for bulk processing and job queuing
External tool (again)

This is most likely what will happen, with the repo on GitLab.

Pros:

  • We can still write the Codex and Vue code with MediaWiki in mind so it's mostly copy/paste to the extension (if we later decide to do that)
  • Code moves faster
  • Cloud Services has superb uptime
  • We could explore server-side rendering
  • GitLab is significantly easier for newcomers to contribute to than Gerrit (as would be required if we went the extension route)

Cons:

  • Does not give this vital tool the WMF ownership it deserves.
    • Though maybe what we build could be deployed as a standalone app, akin but separate to stats.wikimedia.org ?
  • We need a job queue (RabbitMQ or some kind of message broker)
  • Potentially more maintenance with it being outside production

Decision

I've gone with the "external tool" option.

Work-in-progress at:

Details

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I've tagged the components that this app may potentially be part of. If any maintainers or teams disagree and feel this doesn't belong in said component, please feel free to remove the tag(s).

Summary of what was discussed today with the Data Engineering team:

  • The hope is to get this into Wikistats alongside the other official analytics-related tools
  • All of Wikistats is slated to be rewritten in Codex. Yay!
  • We (hopefully) won't need things like Massviews anymore, with the advent of Commons Impact Metrics.
  • Integration into MediaWiki is a maybe and would come later, if at all.
  • Rough plans to start development in early 2025.

(fyi: I'm starting Wikistats maintenance work now, at a reduced 10% time Fridays kind of pace)

MusikAnimal changed the task status from Open to In Progress.Jul 22 2026, 5:41 AM
MusikAnimal claimed this task.

With the help of Claude, we'll soon have Pageviews Analysis & co. fully on Vue/Codex within maybe a week. This would be the "External tool (again)" option mentioned above, designed to be compatible with MW (apart from ESM/CommonJS syntax and such). T420834: Move Pageviews tool to Symfony is a part of this.

Screenshot of a work-in-progress, using Symfony/Vue/Codex/Apache eCharts:

Screenshot from 2026-07-22 01-53-05.png (2,487×1,449 px, 403 KB)

WIP:

We'll likely stick with VPS (the first link) but I wanted to give Toolforge a fair try as per the discussion at T433305.

MusikAnimal renamed this task from Pageviews Analysis 3.0 (Vue + Codex) to Pageviews Analysis 2026 (Vue + Codex).Wed, Aug 26, 4:23 AM
MusikAnimal updated the task description. (Show Details)

A little testing

I tried out both WIP versions using massviews against Quarry query 90922 for the last 30 days.

wmcloud.org version took 214 seconds and 200 seconds against 12147 pages (c. 56 to 60 pages per second).

toolforge.org version failed about half way through with "Could not reach Pageviews API. Please wait a few minutes and try again." error. I figured out that the "Try again" button started from where the query failed, which was a nice touch, though the "time elapsed" in the final output only reflected the time taken for the second half of the run, but my sense was that the rate was comparable to the wmcloud.org version.

Anyway, generally seems about 10x faster than the production massviews, which is great. Thank you.

Change #1333530 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[translatewiki@master] [Pageviews] moved to GitLab; update optional keys

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

Change #1333530 merged by jenkins-bot:

[translatewiki@master] [Pageviews] moved to GitLab; update optional keys

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

MusikAnimal moved this task from In Development to Done on the Tool-Pageviews board.

I think we should advertise in Tech News, especially given the new features. I've added an entry: https://meta.wikimedia.org/?diff=31006160