Help:Con­figu­ration para­meter "$smwgQueryProfiler"

From semantic-mediawiki.org
Jump to: navigation, search
edit with form


Title $smwgQueryProfiler
Description Sets whether specific monitorable profile data are recorded
Default setting
true
Software Semantic MediaWiki
First version supported
Last version supported still available
Configuration Installation
Keyword monitoring · profiling

$smwgQueryProfiler is a configuration parameter that sets whether specific monitorable profile data for queries such as query duration and query parameters are recorded or not. The setting was introduced in Semantic MediaWiki 1.9.0Released on 3 January 2014 and compatible with MW 1.19.0 - 1.22.x..1 Starting with Semantic MediaWiki 2.5.0Released on 14 March 2017 and compatible with MW 1.23.0 - 1.29.x. an additional option to record query parameters is available.2

This configuration parameter underwent a major change in Semantic MediaWiki 3.0.0Released on an unknown date and compatible with MW 1.27.0 - 1.30.x. aiming at simplifying the setup.3 Moreover all available query profiling is enabled by default! See this version of the documentation available for releases prior to Semantic MediaWiki 3.0.0Released on an unknown date and compatible with MW 1.27.0 - 1.30.x..

Default setting

$smwgQueryProfiler = true;

Available options

NoteNote: The option's strings have changed starting with Semantic MediaWiki 3.0.0Released on an unknown date and compatible with MW 1.27.0 - 1.30.x..
  • SMW_QPRFL_DUR - Allows recording the query duration (the time between the query result selection and its output) / since Semantic MediaWiki 1.9.0Released on 3 January 2014 and compatible with MW 1.19.0 - 1.22.x.
  • SMW_QPRFL_PARAMS - Allows recording the query parameters (the parameters like limits and sorting influencing on how and which results are selected for the output) / since Semantic MediaWiki 2.5.0Released on 14 March 2017 and compatible with MW 1.23.0 - 1.29.x.

Changing the default setting

If you change the setting for this configuration parameter, please ensure to run maintenance script "setupStore.php"Allows to set up the data backend/store followed by maintenance script "rebuildData.php"Allows to rebuild all the semantic data for a selected data backend/store.

To modify this configuration setting, add one of the following lines to your "LocalSettings.php" file after the enableSemantics() call:

Disable the query duration from being recorded
$smwgQueryProfiler = ( $smwgQueryProfiler & ~SMW_QPRFL_DUR );
NoteNote: Please use parentheses4 when combining different bit-operations to avoid a possible mismatch.


Disable the query parameters from being recorded
$smwgQueryProfiler = ( $smwgQueryProfiler & ~SMW_QPRFL_PARAMS );
NoteNote: Please use parentheses4 when combining different bit-operations to avoid a possible mismatch.


Disable the query duration and query parameters from being recorded
$smwgQueryProfiler = ( $smwgQueryProfiler & ~SMW_QPRFL_DUR & ~SMW_QPRFL_PARAMS );
NoteNote: Please use parentheses4 when combining different bit-operations to avoid a possible mismatch.


Disable all query profiling including size, depth, format and string from being recorded
$smwgQueryProfiler = false;
This setting is not recommended since the disabled functionality may impact secondary processes that rely on profile information to be available (notification system etc.).

See also

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:30
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:2270
  3. ^  Semantic MediaWiki: GitHub pull request gh:smw:2732
  4. a b c  Bitwise Operators to use parentheses to ensure the desired precedence ...