Improved performance profiler

This commit is contained in:
Michael 2020-12-09 22:10:27 +00:00
parent 9c0342b907
commit 5fb83d0632
5 changed files with 33 additions and 7 deletions

View file

@ -134,7 +134,7 @@ class Profiler implements ContainerInterface
public function resetPerformance()
{
$this->performance = [];
$this->performance['start'] = microtime(true);
$this->performance['start'] = $this->performance['ready'] = microtime(true);
$this->performance['database'] = 0;
$this->performance['database_write'] = 0;
$this->performance['cache'] = 0;
@ -145,6 +145,9 @@ class Profiler implements ContainerInterface
$this->performance['parser'] = 0;
$this->performance['marktime'] = 0;
$this->performance['marktime'] = microtime(true);
$this->performance['frontend'] = 0;
$this->performance['init'] = 0;
$this->performance['content'] = 0;
}
/**
@ -277,6 +280,11 @@ class Profiler implements ContainerInterface
}
}
public function set($timestamp, $id)
{
$this->performance[$id] = $timestamp;
}
/**
* Returns true if the container can return an entry for the given identifier.
* Returns false otherwise.