You are here

function perfmon_get_last_test in Performance monitor 8

Same name and namespace in other branches
  1. 7 perfmon.module \perfmon_get_last_test()

Retrieve the result from the last run of test.

Return value

array Return last results

See also

perfmon_get_stored_results()

1 call to perfmon_get_last_test()
_perfmon_run_test in ./perfmon.module
Run a single Security Review check.

File

./perfmon.module, line 633
Stand-alone perfmon test system.

Code

function perfmon_get_last_test($testname) {
  $query = \Drupal::database()
    ->select('perfmon', 'pm');
  $query
    ->fields('pm', [
    'testname',
    'result',
    'lastrun',
  ]);
  $query
    ->condition('pm.testname', $testname);
  $result = $query
    ->fetchAssoc();
  if (!empty($result)) {
    return $result;
  }
  return FALSE;
}