You are here

protected static function StatsD::sanitizeDataNames in StatsD 7

Sanitize the series names that will be passed into statsd.

Parameters

$data: An array of key value pairs to sanitize.

return array

1 call to StatsD::sanitizeDataNames()
StatsD::send in includes/statsd.inc
Squirt the metrics over UDP.

File

includes/statsd.inc, line 210

Class

StatsD
Sends statistics to the stats daemon over UDP

Code

protected static function sanitizeDataNames($data) {
  foreach ($data as $key => $value) {
    $name = preg_replace(STATSD_SERIES_INVALID_CHARACTERS, variable_get('statsd_series_replacement', '-'), $key);
    $return[$name] = $value;
  }
  return $return;
}