Merge pull request #6641 from nupplaphil/config_followup

Config FollowUp
This commit is contained in:
Hypolite Petovan 2019-02-17 17:56:31 -05:00 committed by GitHub
commit 256e845c5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
75 changed files with 2606 additions and 1368 deletions

View file

@ -326,69 +326,7 @@ function api_call(App $a)
Logger::info(API_LOG_PREFIX . 'username {username}', ['module' => 'api', 'action' => 'call', 'username' => $a->user['username'], 'duration' => round($duration, 2)]);
if (Config::get("system", "profiler")) {
$duration = microtime(true)-$a->performance["start"];
/// @TODO round() really everywhere?
Logger::debug(
API_LOG_PREFIX . 'performance',
[
'module' => 'api',
'action' => 'call',
'database_read' => round($a->performance["database"] - $a->performance["database_write"], 3),
'database_write' => round($a->performance["database_write"], 3),
'cache_read' => round($a->performance["cache"], 3),
'cache_write' => round($a->performance["cache_write"], 3),
'network_io' => round($a->performance["network"], 2),
'file_io' => round($a->performance["file"], 2),
'other_io' => round($duration - ($a->performance["database"]
+ $a->performance["cache"] + $a->performance["cache_write"]
+ $a->performance["network"] + $a->performance["file"]), 2),
'total' => round($duration, 2)
]
);
if (Config::get("rendertime", "callstack")) {
$o = "Database Read:\n";
foreach ($a->callstack["database"] as $func => $time) {
$time = round($time, 3);
if ($time > 0) {
$o .= $func . ": " . $time . "\n";
}
}
$o .= "\nDatabase Write:\n";
foreach ($a->callstack["database_write"] as $func => $time) {
$time = round($time, 3);
if ($time > 0) {
$o .= $func . ": " . $time . "\n";
}
}
$o = "Cache Read:\n";
foreach ($a->callstack["cache"] as $func => $time) {
$time = round($time, 3);
if ($time > 0) {
$o .= $func . ": " . $time . "\n";
}
}
$o .= "\nCache Write:\n";
foreach ($a->callstack["cache_write"] as $func => $time) {
$time = round($time, 3);
if ($time > 0) {
$o .= $func . ": " . $time . "\n";
}
}
$o .= "\nNetwork:\n";
foreach ($a->callstack["network"] as $func => $time) {
$time = round($time, 3);
if ($time > 0) {
$o .= $func . ": " . $time . "\n";
}
}
Logger::debug(API_LOG_PREFIX . $o, ['module' => 'api', 'action' => 'call']);
}
}
$a->getProfiler()->saveLog($a->getLogger(), API_LOG_PREFIX . 'performance');
if (false === $return) {
/*