File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ public function handle()
5959
6060 $ dataArray = [
6161 'name ' => 'speedtest ' ,
62- 'tags ' => null ,
62+ 'tags ' => $ this -> result -> formatTagsForInfluxDB2 () ,
6363 'fields ' => $ this ->result ->formatForInfluxDB2 (),
6464 'time ' => strtotime ($ this ->result ->created_at ),
6565 ];
Original file line number Diff line number Diff line change @@ -54,6 +54,18 @@ class Result extends Model
5454 'created ' => ResultCreated::class,
5555 ];
5656
57+ /**
58+ * The tag attributes to be passed to influxdb
59+ */
60+ public function formatTagsForInfluxDB2 (): array
61+ {
62+ return [
63+ 'server_id ' => (int ) $ this ->server_id ,
64+ 'server_host ' => $ this ->server_host ,
65+ 'server_name ' => $ this ->server_name ,
66+ ];
67+ }
68+
5769 /**
5870 * The attributes to be passed to influxdb
5971 */
You can’t perform that action at this time.
0 commit comments