Skip to content

Commit 96b9420

Browse files
Merge branch '6.0' into 6.1
* 6.0: [HttpFoundation] Fix bad return type in IpUtils::checkIp4() [DependencyInjection] Fix order of arguments when mixing positional and named ones [HttpClient] Fix collecting data non-late for the profiler [Security/Http] Fix compat of persistent remember-me with legacy tokens Bump Symfony version to 6.0.20 Update VERSION for 6.0.19 Update CHANGELOG for 6.0.19 Bump Symfony version to 5.4.20 Update VERSION for 5.4.19 Update CONTRIBUTORS for 5.4.19 Update CHANGELOG for 5.4.19 [Security/Http] Remove CSRF tokens from storage on successful login [HttpKernel] Remove private headers before storing responses with HttpCache
2 parents 36ed2c2 + 541c045 commit 96b9420

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

DataCollector/HttpClientDataCollector.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,28 @@ public function registerClient(string $name, TraceableHttpClient $client)
4141
*/
4242
public function collect(Request $request, Response $response, \Throwable $exception = null)
4343
{
44+
$this->lateCollect();
4445
}
4546

4647
public function lateCollect()
4748
{
48-
$this->reset();
49+
$this->data['request_count'] = 0;
50+
$this->data['error_count'] = 0;
51+
$this->data += ['clients' => []];
4952

5053
foreach ($this->clients as $name => $client) {
5154
[$errorCount, $traces] = $this->collectOnClient($client);
5255

53-
$this->data['clients'][$name] = [
54-
'traces' => $traces,
55-
'error_count' => $errorCount,
56+
$this->data['clients'] += [
57+
$name => [
58+
'traces' => [],
59+
'error_count' => 0,
60+
],
5661
];
5762

63+
$this->data['clients'][$name]['traces'] = array_merge($this->data['clients'][$name]['traces'], $traces);
5864
$this->data['request_count'] += \count($traces);
59-
$this->data['error_count'] += $errorCount;
65+
$this->data['error_count'] += $this->data['clients'][$name]['error_count'] += $errorCount;
6066

6167
$client->reset();
6268
}

0 commit comments

Comments
 (0)