You are here

function perfmon_get_stored_results in Performance monitor 8

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

Retrieve stored tests and results.

Return value

array Array of checks with keys: testname - string test name result - int result of test lastrun - UNIX timestamp of last time check ran

1 call to perfmon_get_stored_results()
PerfmonController::mainPage in src/Controller/PerfmonController.php
Main perform results page callback.

File

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

Code

function perfmon_get_stored_results() {

  // Retrieve results from last run of the checklist.
  $connection = \Drupal::database();
  $query = $connection
    ->query("SELECT testname, result, lastrun FROM {perfmon}");
  $result = $query
    ->fetchAll();
  $tests = [];
  foreach ($result as $record) {
    $tests[] = array(
      'testname' => $record->testname,
      'result' => $record->result,
      'lastrun' => $record->lastrun,
    );
  }
  return $tests;
}