Statistics Parameters
Reference
The statistics parameters live in the "Statistics Plugin" section of xwiki/WEB-INF/xwiki.cfg, where 1 means true and 0 means false. They are read at startup, so a change takes effect only on the next restart.
| Parameter | Default | Shipped as | What it does |
|---|---|---|---|
| xwiki.stats | 1 | commented out | Turns the statistics module on or off for the whole instance: the storage thread and the page-view listener. |
| xwiki.stats.default | 0 | xwiki.stats.default=0 | Whether page views are stored for a wiki that does not define the statistics field described below. Shipped as 0, which is why storage is off on a new instance. |
| xwiki.stats.request.excludedUsersAndGroups | empty | commented out, without a value | The users and groups filtered out of the statistics a request displays. Their views are still stored. |
| xwiki.stats.storage.excludedUsersAndGroups | empty | absent from the file | The users and groups whose views are never stored at all. |
| xwiki.stats.class | com.xpn.xwiki.stats.impl.XWikiStatsServiceImpl | commented out | The implementation that records the statistics, for an instance that records them somewhere other than the XWiki database. |
Three of them can be overridden per wiki, by a field of that wiki's XWiki.XWikiPreferences object, which wins over the file whenever it is not empty:
| Parameter | Field of XWiki.XWikiPreferences |
|---|---|
| xwiki.stats.default | statistics |
| xwiki.stats.request.excludedUsersAndGroups | statistics_request_excludedUsersAndGroups |
| xwiki.stats.storage.excludedUsersAndGroups | statistics_storage_excludedUsersAndGroups |
The statistics field does not exist until you create it. See Enable Statistics for a Subwiki.
Both lists are comma-separated, and an entity written without a wiki, such as XWiki.Admin, means that user on the wiki being read, while xwiki:XWiki.Admin means the one of the main wiki. A comma inside a name is escaped with a backslash.
This is how the two switches appear in the shipped file:
#-# Stats configuration allows to globally activate/deactivate stats module (launch storage thread, register events...).
#-# Enabled by default.
# xwiki.stats=1
#-# When statistics are globally enabled, storage can be enabled/disabled by wiki using the XWikiPreference property
#-# "statistics".
#-# Note: Statistics are disabled by default for improved performances/space.
xwiki.stats.default=0The shipped file also documents xwiki.stats.excludedUsersAndGroups as the parameter that skips users "when storing statistics". That comment is wrong: the parameter has been deprecated since XWiki 2.5 and is only read as a fallback for the request filter. The storage filter is xwiki.stats.storage.excludedUsersAndGroups, which the shipped file does not mention at all.
FAQ
Can I exclude a whole group instead of listing users?
Yes. Both lists accept groups, and a group is expanded into its members every time the filter is read, so a user added to the group later is excluded too.