You are here

function performance_menu in Performance Logging and Monitoring 6.2

Same name and namespace in other branches
  1. 5 performance.module \performance_menu()
  2. 6 performance.module \performance_menu()
  3. 7.2 performance.module \performance_menu()
  4. 7 performance.module \performance_menu()

Implementation of hook_menu().

File

./performance.module, line 31
Logs detailed and/or summary page generation time and memory consumption for page requests. Copyright Khalid Baheyeldin 2008 of http://2bits.com

Code

function performance_menu() {
  $items = array();
  $items[PERFORMANCE_SETTINGS] = array(
    'title' => 'Performance logging',
    'description' => 'Logs performance data: page generation times and memory usage.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'performance_settings_form',
    ),
    'access arguments' => array(
      'administer performance logging',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  $items['admin/reports/performance-logging'] = array(
    'title' => 'Performance logs',
    'description' => 'View summary performance logs: page generation times and memory usage.',
    'page callback' => 'performance_view_summary',
    'access arguments' => array(
      'administer performance logging',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  $items['admin/reports/performance-logging/summary'] = array(
    'title' => 'Summary',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 0,
  );
  $items['admin/reports/performance-logging/details'] = array(
    'title' => 'Details',
    'description' => 'View detailed, per page, performance logs: page generation times and memory usage.',
    'page callback' => 'performance_view_details',
    'access arguments' => array(
      'administer performance logging',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
  );

  // We use no % after clear here (clear/%) to catch the arguments because we do
  // not want the clear page to fall back on its parent when no argument is
  // passed. See the callback of the page for more info.
  $items['admin/reports/performance-logging/clear'] = array(
    'title' => 'Clear logs',
    'description' => 'Clears all collected performance statistics.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'performance_clear_form',
    ),
    'access arguments' => array(
      'administer performance logging',
    ),
    'type' => MENU_CALLBACK,
    'weight' => 1,
  );
  return $items;
}