You are here

function statsd_call in StatsD 6

Same name and namespace in other branches
  1. 7.2 statsd.module \statsd_call()
  2. 7 statsd.module \statsd_call()

The generic statsd wrapper. Used for convenience.

Parameters

$name: Name of the value you want to track.

$type: The type of action you want to take with the value.

$value: The numeric value you wish to pass to statsd.

4 calls to statsd_call()
statsd_exit in ./statsd.module
Implementation of hook_exit()
statsd_user_login in ./statsd.module
Implementation of hook_user_login()
statsd_user_login_failed in ./statsd.module
Send failed login attempt
statsd_watchdog in ./statsd.module
Implementation of hook_watchdog()

File

./statsd.module, line 134

Code

function statsd_call($name, $type = 'increment', $value = NULL) {
  require_once __DIR__ . '/includes/statsd.inc';
  switch ($type) {
    case 'increment':
      StatsD::updateStats($name, isset($value) ? $value : 1);
      break;
    case 'decrement':
      StatsD::updateStats($name, isset($value) ? $value : -1);
      break;
    case 'gauge':
      StatsD::gauge($name, $value);
      break;
    case 'timing':
      StatsD::timing($name, $value);
      break;
    default:
      watchdog('statsd', 'Unknown method called for statsd: %type', array(
        '%type' => $type,
      ), WATCHDOG_WARNING);
      break;
  }
}