1
0
Fork 0

Improvements how gcontact entries are updated

This commit is contained in:
Michael Vogel 2016-02-13 12:26:58 +01:00
commit 2ca6cdf6b6
7 changed files with 133 additions and 214 deletions

View file

@ -1037,19 +1037,29 @@ class App {
$this->performance[$value] += (float)$duration;
$this->performance["marktime"] += (float)$duration;
// Trace the different functions with their timestamps
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 5);
$callstack = $this->callstack();
$this->callstack[$value][$callstack] += (float)$duration;
}
/**
* @brief Returns a string with a callstack. Can be used for logging.
*
* @return string
*/
function callstack() {
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 6);
// We remove the first two items from the list since they contain data that we don't need.
array_shift($trace);
array_shift($trace);
$function = array();
$callstack = array();
foreach ($trace AS $func)
$function[] = $func["function"];
$function = implode(", ", $function);
$this->callstack[$value][$function] += (float)$duration;
$callstack[] = $func["function"];
return implode(", ", $callstack);
}
function mark_timestamp($mark) {