mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-21 21:33:08 +01:00
Updated latest endpoint to ignore failed tests in averages
This commit is contained in:
@@ -71,8 +71,10 @@ class SpeedtestController extends Controller
|
|||||||
{
|
{
|
||||||
$data = SpeedtestHelper::latest();
|
$data = SpeedtestHelper::latest();
|
||||||
$avg = Speedtest::select(DB::raw('AVG(ping) as ping, AVG(download) as download, AVG(upload) as upload'))
|
$avg = Speedtest::select(DB::raw('AVG(ping) as ping, AVG(download) as download, AVG(upload) as upload'))
|
||||||
|
->where('failed', false)
|
||||||
->get();
|
->get();
|
||||||
$max = Speedtest::select(DB::raw('MAX(ping) as ping, MAX(download) as download, MAX(upload) as upload'))
|
$max = Speedtest::select(DB::raw('MAX(ping) as ping, MAX(download) as download, MAX(upload) as upload'))
|
||||||
|
->where('failed', false)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
if($data) {
|
if($data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user