Manual:$wgHitcounterUpdateFreq/zh

From Linux Web Expert

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
<translate> Statistics and content analysis</translate>: $wgHitcounterUpdateFreq
设置应该更新页面计数器的频率。
<translate> Introduced in version:</translate>1.2.0
<translate> Removed in version:</translate>1.25.0 (Gerrit change 150699; git #90d90dad)
<translate> Allowed values:</translate>(整数)
<translate> Default value:</translate>1

细节

设置应该更新页面计数器的频率,在数据库上更容易获得更高的值。 A value of 1 causes the counters to be updated on every hit, any higher value n cause them to update on average every n hits. Should be set to either 1 or something largish, e.g. 1000, for maximum efficiency.

To disable the page counters entirely, set $wgDisableCounters to true.

This setting is ignored if using sqlite for the database.

技术细节

When this setting is set to a number bigger than 1, the page id of any page viewed is stored in the hitcounter table. About 1 in every ($wgHitcounterUpdateFreq)*0.25 hits, the number of entries in the hit counter table is checked. If there is more than $wgHitcounterUpdateFreq entries in the hitcounter table, then those pageviews are transfered in batch to the page_counter field (and the hitcounter table is emptied).

參見