Improvements how gcontact entries are updated
This commit is contained in:
parent
036311237f
commit
2ca6cdf6b6
7 changed files with 133 additions and 214 deletions
26
boot.php
26
boot.php
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue