Rozšíření:ApiFeatureUsage

This page is a translated version of the page Extension:ApiFeatureUsage and the translation is 11% complete.
Základní informace k tomuto rozšíření MediaWiki
ApiFeatureUsage
Stav rozšíření: stabilní
Zavádění Speciální stránka , API
Popis Přehledy protokolu využití funkcí Access API
Napsal(i) Brad Jorsch (Anomiediskuse)
Nejnovější verze 1.0 (2016-12-07)
Zásady kompatibility Vydání snímků následuje MediaWiki. Hlavní vývojová větev není zpětně kompatibilní.
MediaWiki 1.25+
PHP 5.5.9+
Změny v databázi Ne
Licence GNU General Public License 2.0 nebo pozdější
Zdrojový kód
  • $wgApiFeatureUsageQueryEngineConf
Čtvrtletní stahování 16 (Ranked 131st)
Používání veřejných wikin 847 (Ranked 303rd)
Přeložte rozšíření ApiFeatureUsage
Problémy Otevřené úkoly · Nahlásit chybu

Rozšíření ApiFeatureUsage přidává speciální stránku a modul API pro načítání souhrnů dat zaznamenaných pomocí ApiBase::logFeatureUsage(), což je obvykle známkou použití zastaralých funkcí API.

Závislosti

Log data must be added to some sort of storage system. Currently Elasticsearch is supported via Extension:Elastica .

Installation

  • Stáhněte soubor/y a vložte je do adresáře pojmenovaného ApiFeatureUsage ve vaší složce extensions/.
    Vývojáři a přispěvatelé kódu by si místo toho měli nainstalovat rozšíření from Git pomocí:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ApiFeatureUsage
  • Na konec vašeho souboru LocalSettings.php přidejte následující kód:
    wfLoadExtension( 'ApiFeatureUsage' );
    
  •   Dokončeno – Přejděte na stránku Special:Version vaší wiki a zkontrolujte, zda bylo rozšíření úspěšně nainstalováno.

Configuration

Parameters
Name Description
$wgApiFeatureUsageQueryEngineConf Configuration array for accessing the log storage backend.
class
Backend access class to instantiate. Either this or factory is required.
factory
PHP callable which must return an instance of a backend access class. Either this or class is required.
Elastica backend (ApiFeatureUsageQueryEngineElastica)

Additional configuration values in $wgApiFeatureUsageQueryEngineConf:

serverList
Array of Elasticsearch servers. Required.
maxConnectionAttempts
Maximum connection attempts, default 1.
indexPrefix
Prefix for the indexes to use. Default "apifeatureusage-".
indexFormat
Date formatting for the indexes to use, see the PHP manual. Default "Y.m.d".
type
Elasticsearch type to query. Default "api-feature-usage-sanitized".
featureField
Field name for the logged value of $feature. Default "feature".
timestampField
Field name for the logged timestamp. Default "@timestamp".
agentField
Field name for the logged user agent. Default "agent".

Usage

The extension adds a new special page, Special:ApiFeatureUsage, with a simple form to request a summary of feature usage logs for a user agent and date range.

The extension also adds an API query submodule, meta=featureusage. See the auto-generated API documentation for details.

See also