扩展:ApiFeatureUsage

From mediawiki.org
This page is a translated version of the page Extension:ApiFeatureUsage and the translation is 34% complete.
MediaWiki扩展手册
ApiFeatureUsage
发行状态: 稳定版
实现 特殊页面 , API
描述 Access API功能使用日志摘要
作者 Brad Jorsch (Anomie留言)
最新版本 1.0 (2016-12-07)
兼容性政策 快照跟随MediaWiki发布。 master分支不向后兼容。
MediaWiki 1.25+
PHP 5.5.9+
数据库更改
许可协议 GNU通用公眾授權條款2.0或更新版本
下載
  • $wgApiFeatureUsageQueryEngineConf
季度下載量 19 (Ranked 128th)
正在使用的公开wiki数 847 (Ranked 303rd)
翻译ApiFeatureUsage扩展
問題 开启的任务 · 报告错误

ApiFeatureUsage 扩展添加了一个特殊页面和一个 API 模块来获取 ApiBase::logFeatureUsage() 记录的数据摘要,这通常表明使用了已弃用的 API 功能。

依赖性

日志数据必须添加到某种存储系统中。目前 Elasticsearch 通过 扩展:Elastica 获得支持。

安裝

  • 下载文件,并将其放置在您extensions/文件夹中的ApiFeatureUsage目录内。
    开发者和代码贡献人员应从Git安装扩展,输入:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ApiFeatureUsage
  • 将下列代码放置在您的LocalSettings.php 的底部:
    wfLoadExtension( 'ApiFeatureUsage' );
    
  • Yes 完成 – 在您的wiki上导航至Special:Version,以验证已成功安装扩展。

配置

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".

用法

该扩展添加了一个新的特殊页面 Special:ApiFeatureUsage,其中包含一个简单的表单来请求用户代理和日期范围内的功能使用日志摘要。

该扩展还添加了一个 API 查询子模块,meta=featureusage。 有关详细信息,请参阅自动生成的 API 文档

参见