mirror of
https://github.com/grocy/grocy.git
synced 2026-04-08 13:46:14 +02:00
get timings for db-changed-time
This commit is contained in:
parent
6e4f31727b
commit
91034d333b
11
app.php
11
app.php
|
|
@ -108,4 +108,15 @@ $app = new \Slim\App($appContainer);
|
||||||
// Load routes from separate file
|
// Load routes from separate file
|
||||||
require_once __DIR__ . '/routes.php';
|
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();
|
$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);
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,19 @@ class SystemApiController extends BaseApiController
|
||||||
|
|
||||||
public function GetDbChangedTime(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function GetDbChangedTime(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->ApiResponse(array(
|
$fp = fopen('/config/data/sql.log', 'a');
|
||||||
'changed_time' => $this->DatabaseService->GetDbChangedTime()
|
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)
|
public function LogMissingLocalization(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user