Extension:NavigationTiming

This page is a translated version of the page Extension:NavigationTiming and the translation is 25% complete.
MediaWiki 拡張機能マニュアル
NavigationTiming
リリースの状態: 安定
実装 Ajax
説明 Logs perceived latency measurements from client-side
作者 Patrick Reilly, Ori Livneh, Asher Feldman, Timo Tijhof, Ian Marlier
互換性の方針 MediaWiki とともにリリースされるスナップショット。 master には後方互換性がありません。
MediaWiki >= 1.42
データベースの変更 いいえ
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
README
  • $wgNavigationTimingSamplingFactor
  • $wgNavigationTimingCpuBenchmarkSamplingFactor
Quarterly downloads 4 (Ranked 141st)
Public wikis using 846 (Ranked 308th)
translatewiki.net で翻訳を利用できる場合は、NavigationTiming 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

The NavigationTiming extension measures perceived latency in browsers. The extension is named after the W3C Navigation Timing API in web browsers, but today collects metrics from several different browser APIs.

よくある質問

Scope

The extension collects anonimised information from a sample of page views. The collection uses JavaScript and thus is limited to pageviews that:

  1. are from a modern browser, as defined by the Grade A capability check (90%+ of traffic).
  2. have the Navigation Timing API, (98% of browser traffic in 2022, 95% in Nov 2017[1])
  3. reach the "page loaded" event (99%+ of page loads).
  4. are in the random sample (configurable).

How is the information used?

 
Infrastructure for navtiming at WMF.

Engineers at Wikimedia Foundation intend to use this data to assess the impact (positive and negative) of changes to application code and server configuration. Thus guiding on-going work on site performance.

Dependencies

Installation

  • ダウンロードして、ファイルをextensions/フォルダー内のNavigationTimingという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/NavigationTiming
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'NavigationTiming' );
    $wgNavigationTimingSamplingFactor = 1;  // 100% (1 of every 1)
    
  •   完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

Oversampling

Oversampling allows us to selectively sample a larger portion of the traffic coming from a particular geography, or with a specific User Agent string in the browser.

Use cases for this include:

  • obtain detailed observations of a change in performance, based data center location
  • evaluate a change in performance due to browser upgrades (e.g. upstream Firefox 57 released an internal change intended to improve performance).

Oversampling is configured using the $wgNavigationTimingOversampleFactor variable. This variable is an associative array, and the keys that are checked are "geo" and "userAgent".

If the user's country code is included in the "geo" array, then a sample is taken with frequency 1/samplerate. If the user's browser has a User Agent string that matches a key in the userAgent array, then a sample is taken with frequency 1/samplerate. No more than one oversample is taken for a given pageload.

If the page load is oversampled, the emitted event will include these properties:

  • isOversample: true
  • oversampleReason: string, whose contents are a JSON array of reasons that the oversample happened. These will be of the form "geo:XX" (where XX is the matching country code), or "ua:ABCDEF" (where ABCDEF is the matching browser's User Agent string)

Further reading

About the data we collect:

About the Navigation Timing API in web browsers:

Code stewardship

Footnotes