You are here

function _perfmon_performance_tests in Performance monitor 7

Same name and namespace in other branches
  1. 8 perfmon.module \_perfmon_performance_tests()

Core Perfmon checks.

2 calls to _perfmon_performance_tests()
perfmon_get_testlist in ./perfmon.inc
Get core performance tests.
perfmon_run in ./perfmon.inc
Public function for running Perfmon tests and returning results.

File

./perfmon.inc, line 75
Stand-alone perfmon test system.

Code

function _perfmon_performance_tests() {
  $tests = array();
  $tests['config'] = array(
    'bold' => TRUE,
    'title' => t('Performance score'),
    'callback' => 'perfmon_test_server_configuration',
    'description' => t('Drupal installation files and directories (except required) are not writable by the server.'),
  );
  $tests['cpu'] = array(
    'title' => t('CPU (ops per second)'),
    'callback' => 'perfmon_test_cpu',
    'description' => t('Untrusted users are not allowed to input dangerous HTML tags.'),
  );
  $tests['files'] = array(
    'title' => t('Files operations (ops per second)'),
    'callback' => 'perfmon_test_filesop',
    'description' => t('Dangerous tags were not found in any submitted content (fields).'),
  );
  $tests['db_read'] = array(
    'title' => t('DB read operations (ops per second)'),
    'callback' => 'perfmon_test_db_read',
    'description' => t('Error reporting set to log only.'),
  );
  $tests['db_write'] = array(
    'title' => t('DB write operations (ops per second)'),
    'callback' => 'perfmon_test_db_write',
    'description' => t('Private files directory is outside the web server root.'),
  );
  $tests['db_update'] = array(
    'title' => t('DB update operations (ops per second)'),
    'callback' => 'perfmon_test_db_update',
    'description' => t('Only safe extensions are allowed for uploaded files and images.'),
  );

  // Allow other modules to define tests.
  $hook = 'perfmon_performance_tests';
  $implements = module_implements($hook);
  foreach ($implements as $k => $module_name) {
    $function_name = $module_name . '_' . $hook;
    if (function_exists($function_name)) {
      $tests += call_user_func($function_name);
    }
  }

  // Allow other modules to alter tests.
  drupal_alter($hook, $tests);
  return $tests;
}