You are here

function performance_drush_command in Performance Logging and Monitoring 6.2

Same name and namespace in other branches
  1. 6 performance.drush.inc \performance_drush_command()
  2. 7.2 performance.drush.inc \performance_drush_command()
  3. 7 performance.drush.inc \performance_drush_command()

Implementation of hook_drush_command().

File

./performance.drush.inc, line 11
Drush integration for the Performance module.

Code

function performance_drush_command() {
  $items = array();
  $limit = "Limit the number of records. Defaults to 25.";
  $direction = "Sort direction, defaults to descending: asc or desc.";
  $items['performance-summary'] = array(
    'callback' => 'drush_performance_summary',
    'description' => "Display the Performance Logging and Monitoring summary entries.",
    'aliases' => array(
      'perf-sm',
    ),
    'arguments' => array(
      'limit' => $limit,
      'orderby' => "The column name to sort on, defaults to last_access: path, last_access, bytes_max, bytes_avg, ms_max, ms_avg, [query_count_max, query_count_avg, query_timer_max, query_timer_avg] or num_accesses.",
      'direction' => $direction,
    ),
    'examples' => array(
      'performance-summary 25' => 'Retrieve last 25 entries.',
      'performance-summary 10 path' => 'Retrieve last 10 entries sorted by path, descending.',
      'performance-summary 40 bytes_avg asc' => 'Retrieve last 40 entries sorted by average size, ascending.',
    ),
  );
  $items['performance-detail'] = array(
    'callback' => 'drush_performance_details',
    'description' => "Display the Performance Logging and Monitoring detail entries.",
    'aliases' => array(
      'perf-dt',
    ),
    'arguments' => array(
      'limit' => $limit,
      'orderby' => "The column name to sort on, defaults to timestamp: pid, timestamp, bytes, ms, [query_count, query_timer], anon or path.",
      'direction' => $direction,
    ),
    'examples' => array(
      'performance-detail 15' => 'Retrieve last 15 entries.',
      'performance-detail 20 query_count' => 'Retrieve last 20 entries sorted by the number of queries, descending.',
      'performance-detail 35 bytes asc' => 'Retrieve last 35 entries sorted by size, ascending.',
    ),
  );
  return $items;
}