Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit 6cd61e5

Browse files
author
Stefan
committed
report benchmark fixes
1 parent 6ebd1f7 commit 6cd61e5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

libs/PHPCrawlerHTTPRequest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ protected function calulateDataTransferRateValues()
544544
*/
545545
protected function openSocket(&$error_code, &$error_string): ?bool
546546
{
547-
PHPCrawlerBenchmark::reset('connecting_server');
547+
#PHPCrawlerBenchmark::reset('connecting_server');
548548
PHPCrawlerBenchmark::start('connecting_server');
549549

550550
// SSL or not?
@@ -628,8 +628,8 @@ protected function openSocket(&$error_code, &$error_string): ?bool
628628
$this->socket = false;
629629
}
630630

631-
632-
$this->server_connect_time = PHPCrawlerBenchmark::stop('connecting_server');
631+
PHPCrawlerBenchmark::stop('connecting_server');
632+
$this->server_connect_time = PHPCrawlerBenchmark::getElapsedTime('connecting_server');
633633

634634
// If socket not opened -> throw error
635635
if ($this->socket == false) {
@@ -691,8 +691,8 @@ protected function readResponseHeader(&$error_code, &$error_string): ?string
691691
// Server responded
692692
if ($server_responded == false) {
693693
$server_responded = true;
694-
$this->server_response_time = PHPCrawlerBenchmark::stop('server_response_time');
695-
694+
PHPCrawlerBenchmark::stop('server_response_time');
695+
$this->server_response_time = PHPCrawlerBenchmark::getElapsedTime('server_response_time');
696696
// Determinate socket prefill size
697697
$status = stream_get_meta_data($this->socket);
698698
$this->socket_prefill_size = $status['unread_bytes'];

libs/ProcessCommunication/PHPCrawlerStatusHandler.php

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ public function updateCrawlerStatus($PageInfo, $abort_reason = null, $first_cont
116116
// server connect time
117117
$crawler_status->sum_server_connect_time += $PageInfo->server_connect_time;
118118
$crawler_status->sum_server_connects++;
119+
119120

120121
// server response time
121122
$crawler_status->sum_server_response_time += $PageInfo->server_response_time;

0 commit comments

Comments
 (0)