get timings for db-changed-time

This commit is contained in:
zebardy 2019-11-19 07:29:26 +00:00
parent 6e4f31727b
commit 91034d333b
2 changed files with 24 additions and 3 deletions

11
app.php
View File

@ -108,4 +108,15 @@ $app = new \Slim\App($appContainer);
// Load routes from separate file
require_once __DIR__ . '/routes.php';
$fp = fopen('/config/data/sql.log', 'a');
fwrite($fp, "!!!App starting run\n");
$run_time_start = microtime(true);
$app->run();
#fwrite($fp, "!!!App - Total dependency load time in seconds: " . $dep_load_time . "\n");
#fwrite($fp, "!!!App - Total app creation time in seconds: " . $app_creation_time . "\n");
fwrite($fp, "!!!App - Total run time in seconds: " . round((microtime(true) - $run_time_start),6) . "\n");
#fwrite($fp, "!!!App - Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
#fwrite($fp, "!!!APP - ini: ".print_r(ini_get_all(),TRUE)."\n");
#fwrite($fp, "!!!APP - opcache status: ".print_r(opcache_get_status(),TRUE)."\n");
#fwrite($fp, "!!!APP - opcache config: ".print_r(opcache_get_configuration(),TRUE)."\n");
fclose($fp);

View File

@ -19,9 +19,19 @@ class SystemApiController extends BaseApiController
public function GetDbChangedTime(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
{
return $this->ApiResponse(array(
'changed_time' => $this->DatabaseService->GetDbChangedTime()
));
$fp = fopen('/config/data/sql.log', 'a');
fwrite($fp, "---- getting db changed time ----\n");
$time_start = microtime(true);
$response = $this->ApiResponse(array(
'changed_time' => $this->DatabaseService->GetDbChangedTime()
));
fwrite($fp, "----Total execution time in seconds: " . round((microtime(true) - $time_start),4) . "\n");
fwrite($fp, "---- time obtained ----\n");
fclose($fp);
return $response;
#return $this->ApiResponse(array(
# 'changed_time' => $this->DatabaseService->GetDbChangedTime()
#));
}
public function LogMissingLocalization(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)