You are here

function monitoring_comment_monitoring_sensor_info in Monitoring 7

Implements monitoring_MODULE_monitoring_sensor_info().

Module: comment

File

./monitoring.monitoring_sensors.inc, line 112
Define default sensors for core and contrib modules.

Code

function monitoring_comment_monitoring_sensor_info() {
  $info = array();
  $info['comment_new'] = array(
    'label' => 'New comments',
    'sensor_class' => 'Drupal\\monitoring\\Sensor\\Sensors\\SensorDatabaseAggregator',
    'value_label' => 'Comments',
    'settings' => array(
      'category' => 'Content',
      'enabled' => TRUE,
      'thresholds' => array(
        'type' => 'exceeds',
        'warning' => 10,
        'critical' => NULL,
      ),
      // Cache for one hour.
      'caching_time' => 3600,
      'table' => 'comment',
      'time_interval_field' => 'created',
      'time_interval_value' => 60 * 60 * 24,
    ),
  );
  return $info;
}