throttle_status

modules/throttle/throttle.module, line 45

Versions
4.6 – 6
throttle_status()

Determine the current load on the site.

Call the throttle_status() function from your own modules, themes, blocks, etc. as follows:

$throttle = module_invoke('throttle', 'status');

to determine the current throttle status. Use module_invoke() so the call will still work if the throttle module is disabled. For example, in your theme you might choose to disable pictures when your site is too busy (reducing bandwidth), or in your modules you might choose to disable some complicated logic when your site is too busy (reducing CPU utilization).

Return value

0 or 1. 0 means that the throttle is currently disabled. 1 means that the throttle is currently enabled. When the throttle is enabled, CPU and bandwidth intensive functionality should be disabled.

▾ 2 functions call throttle_status()

hook_init in developer/hooks/core.php
Perform setup tasks.
throttle_exit in modules/throttle/throttle.module
Implementation of hook_exit().

Code

<?php
function throttle_status() {
  return variable_get('throttle_level', 0);
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.