DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:statdisplay

Statdisplay Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" yes
  • 2020-07-29 "Hogfather" yes

plugin Displays various statistics and bar graphs computed using a log file of all access to DokuWiki pages

Last updated on
2022-12-12
Provides
Syntax, CLI
Repository
Source

Similar to authorstats, statistics, stats

Tagged with chart, statistics

A CosmoCode Plugin

The statdisplay plugin displays various statistics computed using a log file (NCSA combined i.e. like Apache) of all access to DokuWiki pages. The logfile can be read from an Apache log file, or if not available, generated using the logstats plugin.

:!: All generated statistics only use pure PHP and graphs rendering needs GD PHP extension. (Be aware that this particular PHP extension might not be available at your webhosting provider.)

Note: this a complete rewrite of the Plugin originally written by Jean-Françcois Lalande. All previously analyzed data will be analyzed again.

Installation

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

Log Analysis

Once installed and configured through the Configuration Manager, it will automatically start to analyze the log file. To limit the time and memory consumption of the log analysis, this is done in chunks of a maximum number of lines per run. The log file analysis is triggered through DokuWiki's taskrunner mechanism - there is no need to trigger anything manually.

Note: it is important to adjust the number of lines to analyze in the config through the lines parameter. If your wiki has many accesses, the default of 500 may be too low to effectively analyze your logs.

Command Line Interface

The command line interface allows you to quickly catch up with an existing log file. Run it like this in your DokuWiki directory:

  $> ./bin/plugin.php statdisplay parse --lines 4000

Increasing the number of lines analysed at once can increase the effectiveness when running from command line. When the parameter is not given the one from the config is used.

You can also use the CLI to completely reindex your log file (this throws away all previously analyzed data).

  $> ./bin/plugin.php statdisplay parse --clear --lines 4000

Limitations

The plugin tries to limit it's memory usage as far as possible. The log file is only read line-by-line. However all aggregated data is held inside a single memory structure. If you have a lot of accesses, or are running the plugin over a very long period of time, you may need to increase the memory size limit in your php.ini file.

Update frequency

The chunksize that is read is determined by the number in the configuration. This also determinates that the plugin waits for about this number of accesses before another chunk is read. You may want to raise this number for wikis with many active users or lower it for wikis with few active users.

Syntax

To show the result of the log analysis one or more syntax commands need to be used on a wiki page.

The general syntax asks for a command optionally followed by a graph parameter and/or month_year keyword after question mark. If no month is given, the current month is used. Below are all supported syntaxes shown, but not all graph/nograph month/nomonth combinations are shown.

If you want to see non-cached, most current data on the page, it is recommended to add a ~~NOCACHE~~ macro to the page.

Analysis Progress

Displays a simple progress bar to show how much of the log file was already analysed.

{{statdisplay>progress bar}}

Access Summary

Gives a summary table over all accesses that were ever logged:

{{statdisplay>all}}

Get the summary as a line graph:

{{statdisplay>all?graph}}

Limit the graph to a time intervall:

{{statdisplay>all?graph Jan_2011 Dec_2012}}

Month Overview

Give detailed summary table on the accesses during a month.

{{statdisplay>one month}}

Limit the table to a specific month:

{{statdisplay>one month?Oct_2011}}

Daily Accesses

Show the accesses of each day in the current month:

{{statdisplay>month by day}} 

Show the daily accesses as graph:

{{statdisplay>month by day?graph Oct_2011}}

Hourly Accesses

Show how accesses were spread over the different times of the day during the month:

{{statdisplay>month by hour}}

Graph of a particular month by hour:

{{statdisplay>month by hour?graph Oct_2011}}

Top Referrers

Show where people came from this month:

{{statdisplay>top referers}} 

Top Entry-Pages

Show on which pages users arrived first this month:

{{statdisplay>top entries}}

Top URLs

Show the most popular pages in your site this month:

{{statdisplay>top urls}}

Top Browsers

Show the most used browsers this month:

{{statdisplay>user agents}}

Traffic by User

This is a bit more special. It lists the authenticated users that created the most traffic on your site during the last 7 days:

{{statdisplay>traffic by user}}

To show the top 10 users as a graph use this. The workday average is shown as a red line.

{{statdisplay>traffic by user?graph}}
plugin/statdisplay.txt · Last modified: 2024-01-08 16:13 by Aleksandr

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki