Skip to content

Commit 18d9063

Browse files
committed
[HttpClient] Fix data collector
1 parent 3af52ad commit 18d9063

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

DataCollector/HttpClientDataCollector.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public function collect(Request $request, Response $response, \Throwable $except
4343

4444
public function lateCollect()
4545
{
46-
$this->data['request_count'] = 0;
47-
$this->data['error_count'] = 0;
46+
$this->data['request_count'] = $this->data['request_count'] ?? 0;
47+
$this->data['error_count'] = $this->data['error_count'] ?? 0;
4848
$this->data += ['clients' => []];
4949

5050
foreach ($this->clients as $name => $client) {
@@ -59,7 +59,8 @@ public function lateCollect()
5959

6060
$this->data['clients'][$name]['traces'] = array_merge($this->data['clients'][$name]['traces'], $traces);
6161
$this->data['request_count'] += \count($traces);
62-
$this->data['error_count'] += $this->data['clients'][$name]['error_count'] += $errorCount;
62+
$this->data['error_count'] += $errorCount;
63+
$this->data['clients'][$name]['error_count'] += $errorCount;
6364

6465
$client->reset();
6566
}

0 commit comments

Comments
 (0)