You are here

function performance_schema in Performance Logging and Monitoring 7.2

Same name and namespace in other branches
  1. 6.2 performance.install \performance_schema()
  2. 6 performance.install \performance_schema()
  3. 7 performance.install \performance_schema()

Implements hook_schema().

File

./performance.install, line 16
Install and update for Performance Logging

Code

function performance_schema() {
  $schema = array();
  $schema['cache_performance'] = array(
    'description' => 'Table that holds summary performance data.',
    'fields' => array(
      'cid' => array(
        'description' => 'Primary Key: Unique cache ID.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'data' => array(
        'description' => 'A collection of data to cache.',
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
      ),
      'expire' => array(
        'description' => 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'created' => array(
        'description' => 'A Unix timestamp indicating when the cache entry was created.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'serialized' => array(
        'description' => 'A flag to indicate whether content is serialized (1) or not (0).',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'expire' => array(
        'expire',
      ),
    ),
    'primary key' => array(
      'cid',
    ),
  );
  $schema['performance_detail'] = array(
    'fields' => array(
      'pid' => array(
        'description' => 'Primary Key: Unique path ID.',
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'timestamp' => array(
        'description' => 'A Unix timestamp indicating when the entry was created.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'bytes' => array(
        'description' => 'Memory consumed in bytes.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'ms' => array(
        'description' => 'Time consumed in milliseconds.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'query_count' => array(
        'description' => 'Number of queries executed.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'query_timer' => array(
        'description' => 'Time taken to execute queries.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'anon' => array(
        'description' => 'Whether the page was accessed by an anonymous user.',
        'type' => 'int',
        'not null' => FALSE,
        'default' => 1,
      ),
      'path' => array(
        'description' => 'The path the data belongs to.',
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
      ),
      'language' => array(
        'description' => 'The {languages}.language used when calling this path.',
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
        'default' => '',
      ),
      'data' => array(
        'description' => 'Additional (debug) info for future expansion.',
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
      ),
    ),
    'primary key' => array(
      'pid',
    ),
    'indexes' => array(
      'timestamp' => array(
        'timestamp',
      ),
    ),
  );
  return $schema;
}