You are here

function throttle_status in Drupal 4

Same name and namespace in other branches
  1. 5 modules/throttle/throttle.module \throttle_status()
  2. 6 modules/throttle/throttle.module \throttle_status()

Determine the current load on the site.

Call the throttle_status() function from your own modules, themes, blocks, etc. to determine the current throttle status. 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.

File

modules/throttle.module, line 22
Allows configuration of congestion control auto-throttle mechanism.

Code

function throttle_status() {
  return variable_get('throttle_level', 0);
}