You are browsing a read-only backup copy of Wikitech. The live site can be found at


From Wikitech-static
Revision as of 23:40, 28 January 2017 by imported>MusikAnimal (see also)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Toolforge tools
Crystal Clear app package utilities.png Pageviews Analysis
Description Suite of tools to visualize pageviews
Keywords pageviews, statistics, analytics
Author(s) MusikAnimal, Kaldari, Marcel Ruiz Forns
Maintainer(s) MusikAnimal, Kaldari (View all)
Source code GitHub
License GNU General Public License 3.0 or later
Issues Phabricator

Pageviews Analysis is a suite of tools to visualize pageviews data of Wikimedia Foundation wikis. The suite includes seven tools that all share the same codebase: Pageviews, Langviews, Topviews, Siteviews, Redirect Views and Userviews.

See meta:Pageviews Analysis for user documentation.


There is a script to make deployment easier:

$ ssh
$ become pageviews
$ sh
 * branch            master     -> FETCH_HEAD

This script will pull in the new code from master, copy the pageviews/public_html directory to ~/public_html, re-add necessary symlinks, and update the JSDocs (which are at ~/public_html/jsdocs in the pageviews tool).

Setting up a new app

  • become the new tool, then run git clone
  • cd pageviews && composer install
  • Back in the home directory, create a file called config.php. The contents should define the root of the project's codebase, and the URL to the "meta" app's API (explained below):
    // Define the root of the project directory so that the vendor and messages directories
    // can be accessed with non-relative paths.
    define( 'ROOTDIR', '/data/project/mynewtool/pageviews' );
    define( 'METAROOT', '' );
  • Setup the necessary symlinks so that the relative paths point to the right place. Do this by running ln -s public_html/file.php file.php for each necessary file listed below. Afterwards, running ls -al in the home directory should show:
    lrwxrwxrwx    1 tools.mynewtool tools.mynewtool       30 May  5  2016 _browser_check.php -> public_html/_browser_check.php
    lrwxrwxrwx    1 tools.mynewtool tools.mynewtool       22 Jul 29  2016 faq_parts -> public_html/faq_parts/
    lrwxrwxrwx    1 tools.mynewtool tools.mynewtool       23 Apr 18  2016 _footer.php -> public_html/_footer.php
    lrwxrwxrwx    1 tools.mynewtool tools.mynewtool       23 Nov 12 19:06 _header.php -> public_html/_header.php
    lrwxrwxrwx    1 tools.mynewtool tools.mynewtool       21 Apr 18  2016 _head.php -> public_html/_head.php
    lrwxrwxrwx    1 tools.mynewtool tools.mynewtool       30 Apr 19  2016 _lang_selector.php -> public_html/_lang_selector.php
    lrwxrwxrwx    1 tools.mynewtool tools.mynewtool       23 Jun 29  2016 _modals.php -> public_html/_modals.php
    lrwxrwxrwx    1 tools.mynewtool tools.mynewtool       23 Jun 29  2016 _output.php -> public_html/_output.php
    lrwxrwxrwx    1 tools.mynewtool tools.mynewtool       22 Jul 29  2016 url_parts -> public_html/url_parts/
  • Create the script in the home directory, to be used when deploying updates:
    cd ~/pageviews
    git pull origin master
    cd ~
    cp -R pageviews/public_html/mynewtool/* public_html
    cp -R pageviews/public_html/url_parts/ public_html
    cp -R pageviews/public_html/faq_parts/ public_html
    cp pageviews/public_html/_*.php public_html/
  • Finally, start the kubernetes webservice with webservice --backend=kubernetes start

Meta application

Aside from loading translations and a few other things, the Pageviews Analysis suite of apps is entirely clientside. Some functionality depends on API provided by the so-called "meta app", which is currently At some point the API functionality may be migrated to be self-contained within the Pageviews code base. This meta app is also used to record basic usage statistics of each app.

See also