Merge "Refactor ContributionsSpecialPage->contributionsSub to support markup overrides"
[mediawiki.git] / includes / api / Hook / ApiMaxLagInfoHook.php
blob0698840186abe3cf57fa514bb70fd4cebbe2bab6
1 <?php
3 namespace MediaWiki\Api\Hook;
5 /**
6 * This is a hook handler interface, see docs/Hooks.md.
7 * Use the hook name "ApiMaxLagInfo" to register handlers implementing this interface.
9 * @stable to implement
10 * @ingroup Hooks
12 interface ApiMaxLagInfoHook {
13 /**
14 * This hook is called when lag information is being requested via API. Use this hook
15 * to override lag information. Generally a hook function should only replace
16 * $lagInfo if the new $lagInfo['lag'] is greater than the current $lagInfo['lag'].
18 * @since 1.35
20 * @param array &$lagInfo Maximum lag information array. Fields in the array are:
21 * - `lag`: number of seconds of lag
22 * - `host`: host name on which the lag exists
23 * - `type`: an indication of the type of lag. For example: "db" for database
24 * replication lag or "jobqueue" for job queue size converted to pseudo-seconds
26 * You can also add more fields that are returned to the user in the API response.
27 * @return void This hook must not abort, it must return no value
29 public function onApiMaxLagInfo( &$lagInfo ): void;