You are here

function perfmon_test_db_write in Performance monitor 7

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

Test db write operations.

1 string reference to 'perfmon_test_db_write'
_perfmon_performance_tests in ./perfmon.inc
Core Perfmon checks.

File

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

Code

function perfmon_test_db_write() {
  $exectime = 0;
  $count = 1000;
  db_truncate('perfmon_test')
    ->execute();
  $exectime = microtime(TRUE);
  perfmon_test_db_prepare('test_db_write', $count);
  $exectime = microtime(TRUE) - $exectime;
  return array(
    'result' => round(1 / ($exectime / $count), 0),
    'value' => '0',
  );
}