File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ class Result extends Model
4040 */
4141 protected $ casts = [
4242 'scheduled ' => 'boolean ' ,
43+ 'data ' => 'array ' ,
4344 'created_at ' => 'datetime ' ,
4445 ];
4546
@@ -53,10 +54,16 @@ public function formatForInfluxDB2()
5354 'ping ' => (float ) $ this ->ping ,
5455 'download ' => (int ) $ this ->download ,
5556 'upload ' => (int ) $ this ->upload ,
57+ 'download_bits ' => (int ) $ this ->download * 8 ,
58+ 'upload_bits ' => (int ) $ this ->upload * 8 ,
59+ 'ping_jitter ' => (float ) $ this ->data ['ping ' ]['jitter ' ],
60+ 'download_jitter ' => (float ) $ this ->data ['download ' ]['latency ' ]['jitter ' ],
61+ 'upload_jitter ' => (float ) $ this ->data ['upload ' ]['latency ' ]['jitter ' ],
5662 'server_id ' => (int ) $ this ->server_id ,
5763 'server_host ' => $ this ->server_host ,
5864 'server_name ' => $ this ->server_name ,
5965 'scheduled ' => $ this ->scheduled ,
66+ 'packet_loss ' => $ this ->data ['packetLoss ' ],
6067 ];
6168 }
6269}
You can’t perform that action at this time.
0 commit comments