public function latency(&$response)
{
$lastLatency = $this->distributedCache->get('core/latency');
$result = array('frontend' => 0, 'backend' => 0, 'database' => 0, 'session' => 0, 'cache' => 0);
foreach ($result as $key => &$value) {
if (isset($lastLatency[$key])) {
$value = round(array_sum($lastLatency[$key]) / count($lastLatency[$key]) * 1000);
}
}
$response['JarvesBundle/latency'] = $result;
}