You are here

public function SensorInfo::getThresholdValue in Monitoring 7

Returns a given threshold if one is configured.

Parameters

$key: Name of the threshold, for example warning or critical.

Return value

int|null The threshold value or NULL if not-configured.

File

lib/Drupal/monitoring/Sensor/SensorInfo.php, line 191
Contains \Drupal\monitoring\Sensor\SensorInfo.

Class

SensorInfo
Represents a sensor info as defined in hook_monitoring_sensor_info().

Namespace

Drupal\monitoring\Sensor

Code

public function getThresholdValue($key) {
  $thresholds = $this
    ->getSetting('thresholds');
  if (isset($thresholds[$key]) && $thresholds[$key] !== '') {
    return $thresholds[$key];
  }
}