[Cache][WebProfiler] fix collecting cache stats with sub-requests + allow clearing calls
This commit is contained in:
parent
020664e1ef
commit
132bba6d24
|
@ -204,11 +204,12 @@ class TraceableAdapter implements AdapterInterface, PruneableInterface, Resettab
|
|||
|
||||
public function getCalls()
|
||||
{
|
||||
try {
|
||||
return $this->calls;
|
||||
} finally {
|
||||
$this->calls = array();
|
||||
}
|
||||
return $this->calls;
|
||||
}
|
||||
|
||||
public function clearCalls()
|
||||
{
|
||||
$this->calls = array();
|
||||
}
|
||||
|
||||
protected function start($name)
|
||||
|
|
|
@ -57,8 +57,7 @@ class CacheDataCollector extends DataCollector implements LateDataCollectorInter
|
|||
{
|
||||
$this->data = array();
|
||||
foreach ($this->instances as $instance) {
|
||||
// Calling getCalls() will clear the calls.
|
||||
$instance->getCalls();
|
||||
$instance->clearCalls();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue