mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
Update Composer dependencies.
This commit is contained in:
parent
12049cba3a
commit
47fbfd2bca
12558 changed files with 155183 additions and 28099 deletions
|
@ -38,24 +38,29 @@ final class HttpClientDataCollector extends DataCollector implements LateDataCol
|
|||
*/
|
||||
public function collect(Request $request, Response $response, \Throwable $exception = null)
|
||||
{
|
||||
$this->reset();
|
||||
|
||||
foreach ($this->clients as $name => $client) {
|
||||
[$errorCount, $traces] = $this->collectOnClient($client);
|
||||
|
||||
$this->data['clients'][$name] = [
|
||||
'traces' => $traces,
|
||||
'error_count' => $errorCount,
|
||||
];
|
||||
|
||||
$this->data['request_count'] += \count($traces);
|
||||
$this->data['error_count'] += $errorCount;
|
||||
}
|
||||
$this->lateCollect();
|
||||
}
|
||||
|
||||
public function lateCollect()
|
||||
{
|
||||
foreach ($this->clients as $client) {
|
||||
$this->data['request_count'] = 0;
|
||||
$this->data['error_count'] = 0;
|
||||
$this->data += ['clients' => []];
|
||||
|
||||
foreach ($this->clients as $name => $client) {
|
||||
[$errorCount, $traces] = $this->collectOnClient($client);
|
||||
|
||||
$this->data['clients'] += [
|
||||
$name => [
|
||||
'traces' => [],
|
||||
'error_count' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
$this->data['clients'][$name]['traces'] = array_merge($this->data['clients'][$name]['traces'], $traces);
|
||||
$this->data['request_count'] += \count($traces);
|
||||
$this->data['error_count'] += $this->data['clients'][$name]['error_count'] += $errorCount;
|
||||
|
||||
$client->reset();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue