You are here

monitoring.install in Monitoring 7

Same filename and directory in other branches
  1. 8 monitoring.install

Monitoring base install file.

File

monitoring.install
View source
<?php

/**
 * @file
 * Monitoring base install file.
 */

/**
 * Implements hook_schema().
 */
function monitoring_schema() {
  $schema['monitoring_sensor_result'] = array(
    'description' => 'Monitoring sensor data captured on their invocation.',
    'fields' => array(
      'record_id' => array(
        'description' => 'The identifier of the call',
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'sensor_name' => array(
        'description' => 'The sensor name invoked',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
      ),
      'sensor_status' => array(
        'description' => 'Sensor status at the time of the call',
        'type' => 'varchar',
        'length' => '16',
        'not null' => TRUE,
      ),
      'sensor_message' => array(
        'description' => 'Sensor status message',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'sensor_value' => array(
        'description' => 'Sensor value',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
      ),
      'timestamp' => array(
        'description' => 'Timestamp of the sensor call',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'execution_time' => array(
        'description' => 'Sensor execution time duration value in milliseconds',
        'type' => 'numeric',
        'not null' => TRUE,
        'precision' => 10,
        'scale' => 2,
        'default' => 0.0,
      ),
    ),
    'primary key' => array(
      'record_id',
    ),
    'indexes' => array(
      'sensor_name' => array(
        'sensor_name',
      ),
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
monitoring_schema Implements hook_schema().