Merge remote-tracking branch 'upstream/develop' into 1602-remove-simplepie

This commit is contained in:
Michael Vogel 2016-02-16 07:58:01 +01:00
commit ade5ef7065
11 changed files with 320 additions and 239 deletions

View file

@ -1030,19 +1030,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) {