enterprisemediawiki / Wiretap

User pageview tracking for MediaWiki
4 stars 6 forks source link

Add page_counter replacement #4

Closed jamesmontalvo3 closed 8 years ago

jamesmontalvo3 commented 9 years ago

WatchAnalytics relies on MediaWiki's page counter for tracking number of page hits. However this feature was removed in MW 1.25. Wiretap should add it back with greater functionality, namely hit counters for different ranges of time (previous week, month, etc)

jamesmontalvo3 commented 9 years ago

Reference #6

jamesmontalvo3 commented 9 years ago

6 merged. Issue pending close until testing complete.

jamesmontalvo3 commented 8 years ago

This still hasn't been fully tested. Additionally, it would be good if wiretap had a way to record the legacy page counter that goes away in MW 1.25. I think determining page hit counts could be done with the following query (this query is untested):

SELECT
    page.page_id,
    page.page_counter AS legacy_counter,
    wiretap_counter,
    (legacy_counter - wiretap_counter) AS pre_wiretap_count
FROM page
FULL JOIN (
    SELECT
        page_id,
        COUNT(*) AS wiretap_counter
    FROM wiretap
    WHERE page_id > 0
    GROUP BY page_id
) AS tmp ON page.page_id = tmp.page_id
ORDER BY page.page_id ASC;

This does not take into account deleted pages, which are stored in another table. Their total hits should probably be recorded, too.

jamesmontalvo3 commented 8 years ago

Closed via #8