mirror of
https://github.com/alexjustesen/speedtest-tracker.git
synced 2026-06-23 04:20:08 +00:00
chore: update webhook payload (#2636)
This commit is contained in:
@@ -37,7 +37,7 @@ class SendWebhookTestNotification
|
||||
'ping' => $fakeResult->ping,
|
||||
'download' => $fakeResult->download,
|
||||
'upload' => $fakeResult->upload,
|
||||
'packetLoss' => $fakeResult->data['packetLoss'],
|
||||
'packet_loss' => $fakeResult->data['packetLoss'],
|
||||
'speedtest_url' => $fakeResult->data['result']['url'],
|
||||
'url' => url('/admin/results'),
|
||||
])
|
||||
|
||||
@@ -7,6 +7,7 @@ use App\Events\SpeedtestBenchmarkHealthy;
|
||||
use App\Events\SpeedtestBenchmarking;
|
||||
use App\Events\SpeedtestBenchmarkUnhealthy;
|
||||
use App\Helpers\Benchmark;
|
||||
use App\Helpers\Number;
|
||||
use App\Models\Result;
|
||||
use App\Settings\ThresholdSettings;
|
||||
use Illuminate\Bus\Batchable;
|
||||
@@ -83,7 +84,8 @@ class BenchmarkSpeedtestJob implements ShouldQueue
|
||||
'bar' => 'min',
|
||||
'passed' => Benchmark::bitrate($result->download, ['value' => $settings->absolute_download, 'unit' => 'mbps']),
|
||||
'type' => 'absolute',
|
||||
'value' => $settings->absolute_download,
|
||||
'test_value' => Number::bitsToMagnitude(bits: $result->download_bits, precision: 0, magnitude: 'mbit'),
|
||||
'benchmark_value' => $settings->absolute_download,
|
||||
'unit' => 'mbps',
|
||||
]);
|
||||
|
||||
@@ -97,7 +99,8 @@ class BenchmarkSpeedtestJob implements ShouldQueue
|
||||
'bar' => 'min',
|
||||
'passed' => filter_var(Benchmark::bitrate($result->upload, ['value' => $settings->absolute_upload, 'unit' => 'mbps']), FILTER_VALIDATE_BOOLEAN),
|
||||
'type' => 'absolute',
|
||||
'value' => $settings->absolute_upload,
|
||||
'test_value' => Number::bitsToMagnitude(bits: $result->upload_bits, precision: 0, magnitude: 'mbit'),
|
||||
'benchmark_value' => $settings->absolute_upload,
|
||||
'unit' => 'mbps',
|
||||
]);
|
||||
|
||||
@@ -111,7 +114,8 @@ class BenchmarkSpeedtestJob implements ShouldQueue
|
||||
'bar' => 'max',
|
||||
'passed' => Benchmark::ping($result->ping, ['value' => $settings->absolute_ping]),
|
||||
'type' => 'absolute',
|
||||
'value' => $settings->absolute_ping,
|
||||
'test_value' => round($result->ping),
|
||||
'benchmark_value' => $settings->absolute_ping,
|
||||
'unit' => 'ms',
|
||||
]);
|
||||
|
||||
|
||||
@@ -162,10 +162,11 @@ class ProcessCompletedSpeedtest
|
||||
'site_name' => config('app.name'),
|
||||
'server_name' => Arr::get($result->data, 'server.name'),
|
||||
'server_id' => Arr::get($result->data, 'server.id'),
|
||||
'status' => $result->status,
|
||||
'isp' => Arr::get($result->data, 'isp'),
|
||||
'ping' => $result->ping,
|
||||
'download' => $result->downloadBits,
|
||||
'upload' => $result->uploadBits,
|
||||
'ping' => round($result->ping),
|
||||
'download' => Number::bitsToMagnitude(bits: $result->download_bits, precision: 0, magnitude: 'mbit'),
|
||||
'upload' => Number::bitsToMagnitude(bits: $result->upload_bits, precision: 0, magnitude: 'mbit'),
|
||||
'packet_loss' => Arr::get($result->data, 'packetLoss'),
|
||||
'speedtest_url' => Arr::get($result->data, 'result.url'),
|
||||
'url' => url('/admin/results'),
|
||||
|
||||
Reference in New Issue
Block a user