[Cache][WebProfiler] fix collecting cache stats with sub-requests + allow clearing calls

This commit is contained in:
David Maicher 2018-02-07 20:03:36 +01:00
parent 020664e1ef
commit 132bba6d24
2 changed files with 7 additions and 7 deletions

View File

@ -204,11 +204,12 @@ class TraceableAdapter implements AdapterInterface, PruneableInterface, Resettab
public function getCalls() public function getCalls()
{ {
try { return $this->calls;
return $this->calls; }
} finally {
$this->calls = array(); public function clearCalls()
} {
$this->calls = array();
} }
protected function start($name) protected function start($name)

View File

@ -57,8 +57,7 @@ class CacheDataCollector extends DataCollector implements LateDataCollectorInter
{ {
$this->data = array(); $this->data = array();
foreach ($this->instances as $instance) { foreach ($this->instances as $instance) {
// Calling getCalls() will clear the calls. $instance->clearCalls();
$instance->getCalls();
} }
} }