mirror of
https://github.com/friendica/friendica
synced 2024-11-14 04:22:55 +00:00
Added minimal execution time for rendertime addon
This commit is contained in:
parent
752a377269
commit
e4c95efd80
1 changed files with 7 additions and 6 deletions
|
@ -165,10 +165,11 @@ class Profiler implements ContainerInterface
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the rendertime string
|
* Returns the rendertime string
|
||||||
|
* @param int $limit Minimal limit for displaying the execution duration
|
||||||
*
|
*
|
||||||
* @return string the rendertime
|
* @return string the rendertime
|
||||||
*/
|
*/
|
||||||
public function getRendertimeString()
|
public function getRendertimeString(int $limit = 0)
|
||||||
{
|
{
|
||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
|
@ -180,7 +181,7 @@ class Profiler implements ContainerInterface
|
||||||
$output .= "\nDatabase Read:\n";
|
$output .= "\nDatabase Read:\n";
|
||||||
foreach ($this->callstack["database"] as $func => $time) {
|
foreach ($this->callstack["database"] as $func => $time) {
|
||||||
$time = round($time, 3);
|
$time = round($time, 3);
|
||||||
if ($time > 0) {
|
if ($time > $limit) {
|
||||||
$output .= $func . ": " . $time . "\n";
|
$output .= $func . ": " . $time . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -189,7 +190,7 @@ class Profiler implements ContainerInterface
|
||||||
$output .= "\nDatabase Write:\n";
|
$output .= "\nDatabase Write:\n";
|
||||||
foreach ($this->callstack["database_write"] as $func => $time) {
|
foreach ($this->callstack["database_write"] as $func => $time) {
|
||||||
$time = round($time, 3);
|
$time = round($time, 3);
|
||||||
if ($time > 0) {
|
if ($time > $limit) {
|
||||||
$output .= $func . ": " . $time . "\n";
|
$output .= $func . ": " . $time . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -198,7 +199,7 @@ class Profiler implements ContainerInterface
|
||||||
$output .= "\nCache Read:\n";
|
$output .= "\nCache Read:\n";
|
||||||
foreach ($this->callstack["cache"] as $func => $time) {
|
foreach ($this->callstack["cache"] as $func => $time) {
|
||||||
$time = round($time, 3);
|
$time = round($time, 3);
|
||||||
if ($time > 0) {
|
if ($time > $limit) {
|
||||||
$output .= $func . ": " . $time . "\n";
|
$output .= $func . ": " . $time . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,7 +208,7 @@ class Profiler implements ContainerInterface
|
||||||
$output .= "\nCache Write:\n";
|
$output .= "\nCache Write:\n";
|
||||||
foreach ($this->callstack["cache_write"] as $func => $time) {
|
foreach ($this->callstack["cache_write"] as $func => $time) {
|
||||||
$time = round($time, 3);
|
$time = round($time, 3);
|
||||||
if ($time > 0) {
|
if ($time > $limit) {
|
||||||
$output .= $func . ": " . $time . "\n";
|
$output .= $func . ": " . $time . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -216,7 +217,7 @@ class Profiler implements ContainerInterface
|
||||||
$output .= "\nNetwork:\n";
|
$output .= "\nNetwork:\n";
|
||||||
foreach ($this->callstack["network"] as $func => $time) {
|
foreach ($this->callstack["network"] as $func => $time) {
|
||||||
$time = round($time, 3);
|
$time = round($time, 3);
|
||||||
if ($time > 0) {
|
if ($time > $limit) {
|
||||||
$output .= $func . ": " . $time . "\n";
|
$output .= $func . ": " . $time . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue