formatting
This commit is contained in:
parent
a752fb9ecc
commit
99c6c06897
|
|
@ -65,19 +65,6 @@ class HttpStatisticsLogger implements StatisticsLogger
|
||||||
return $this->statistics[$appId];
|
return $this->statistics[$appId];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getUrl(): string
|
|
||||||
{
|
|
||||||
$action = [WebSocketStatisticsEntriesController::class, 'store'];
|
|
||||||
|
|
||||||
$overridenUrl = config('websockets.statistics.base_url_override');
|
|
||||||
|
|
||||||
if ($overridenUrl) {
|
|
||||||
return $overridenUrl.action($action, [], false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return action($action);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
foreach ($this->statistics as $appId => $statistic) {
|
foreach ($this->statistics as $appId => $statistic) {
|
||||||
|
|
@ -92,7 +79,7 @@ class HttpStatisticsLogger implements StatisticsLogger
|
||||||
$this
|
$this
|
||||||
->browser
|
->browser
|
||||||
->post(
|
->post(
|
||||||
$this->getUrl(),
|
$this->storeStatisticsUrl(),
|
||||||
['Content-Type' => 'application/json'],
|
['Content-Type' => 'application/json'],
|
||||||
stream_for(json_encode($postData))
|
stream_for(json_encode($postData))
|
||||||
);
|
);
|
||||||
|
|
@ -101,4 +88,17 @@ class HttpStatisticsLogger implements StatisticsLogger
|
||||||
$statistic->reset($currentConnectionCount);
|
$statistic->reset($currentConnectionCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function storeStatisticsUrl(): string
|
||||||
|
{
|
||||||
|
$action = [WebSocketStatisticsEntriesController::class, 'store'];
|
||||||
|
|
||||||
|
$overridenUrl = config('websockets.statistics.base_url_override');
|
||||||
|
|
||||||
|
if ($overridenUrl) {
|
||||||
|
return $overridenUrl.action($action, [], false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return action($action);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue