Skip to content

Commit caac0c7

Browse files
authored
[Bugfix] Influxdb packet loss type (alexjustesen#726)
1 parent b1f70f0 commit caac0c7

File tree

4 files changed

+483
-14
lines changed

4 files changed

+483
-14
lines changed

app/Jobs/SendDataToInfluxDbV2.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ public function handle(): void
6767
try {
6868
$writeApi->write($dataArray);
6969
} catch (\Exception $e) {
70-
Log::error($e);
70+
Log::info($e);
71+
72+
$this->fail();
7173
}
7274

7375
$writeApi->close();

app/Models/Result.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function formatForInfluxDB2()
9292
'server_name' => $this?->server_name,
9393
'scheduled' => $this->scheduled,
9494
'successful' => $this->successful,
95-
'packet_loss' => Arr::get($data, 'packetLoss'),
95+
'packet_loss' => (float) Arr::get($data, 'packetLoss', 0),
9696
];
9797
}
9898

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"filament/filament": "^2.17.52",
1717
"filament/spatie-laravel-settings-plugin": "^2.17.52",
1818
"guzzlehttp/guzzle": "^7.8",
19-
"influxdata/influxdb-client-php": "^2.9",
19+
"influxdata/influxdb-client-php": "^3.4",
2020
"laravel-notification-channels/telegram": "^4.0",
2121
"laravel/framework": "^10.21",
2222
"laravel/sanctum": "^3.2.6",
@@ -81,7 +81,8 @@
8181
"preferred-install": "dist",
8282
"sort-packages": true,
8383
"allow-plugins": {
84-
"pestphp/pest-plugin": true
84+
"pestphp/pest-plugin": true,
85+
"php-http/discovery": true
8586
}
8687
},
8788
"minimum-stability": "stable",

0 commit comments

Comments
 (0)