Feed on Posts or Comments 06 January 2009

MediaWiki & development robchurch on 27 Jun 2007 09:33 am

Reports and logs

Working on a couple things at the moment; a new reporting mechanism, and some changes to the log formatting code.

Reports

The reporting mechanism will replace the old QueryPage system with a new one based around an abstract Report class, which is then extended to provide concrete functionality. As before, the actual running of the report is done by the superclass, and as before, reports can be cached. However, we’ll be storing sufficient data in the cache to allow filtering by namespace, and excluding redirects, where appropriate.

The report cache script also caches a different set of results for each namespace, so that there’s cached results for all namespaces. What this means is that, for something like Special:WantedPages, we’ll have separate sets for the main namespace, template namespace, etc. so that namespace filtering is still coherent when the cache is in use, as it will be on Wikimedia wikis. Of course, namespace filtering means that some reports have been merged together (Special:UncategorizedPages, Special:UncategorizedImages etc.)

I’ve also found a couple of opportunities to add possibile performance boosts; better indexes and the use of specific thresholds in “longest pages” and “shortest pages”, and something similar in “ancient pages”, which should speed these three up.

Reports are distinguished from other special pages in Special:SpecialPages, and extensions can add their own reports, too, which drop in and work with the report cache right off the bat. I’ve also tweaked the header text and done a lot of UI improvement.

There’s still quite a bit to do at the moment; some final reports need to be ported, and I need to finish rewriting Special:NewPages to be a proper SpecialPage - it was subclassing QueryPage, but there’s absolutely no need for this, since the table it uses - recentchanges - is cached to hell and back. I might end up merging some of the functionality of the NewestPages extension into Special:NewPages, since I’ve had feedback that the extension is better from a user point of view.

Log formatting

The changes to log formatting will mean that we have a clear and consistent single call to format an individual log item from anywhere. Coupled with the storage of some additional data in the recentchanges table, this means that we can go nuts, and have fully internationalised formatted log lines showing up in change lists, too - right now, it’s generated on save (in the content language) and then saved into the recentchanges table.

This allows me to add some much-needed extras and alter some of the log format entries about. For example, when the target is, in fact, a user, then the standard user links can be added. Extensions can either provide a method to do partial formatting, or take over the whole of the formatting process for their log items, which allows maximum flexibility.

This is coming along very successfully, and should also be done soon.

One Response to “Reports and logs”

  1. on 08 Jul 2007 at 1:28 am 1.Aaron said …

    With the addition of log_id coming, do you plan to rewrite logs to use pager?

Trackback This Post | Subscribe to the comments through RSS Feed

Leave a Reply

You must be logged in to post a comment.