Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Jobs/SendDataToInfluxDbV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function handle()

$dataArray = [
'name' => 'speedtest',
'tags' => null,
'tags' => $this->result->formatTagsForInfluxDB2(),
'fields' => $this->result->formatForInfluxDB2(),
'time' => strtotime($this->result->created_at),
];
Expand Down
12 changes: 12 additions & 0 deletions app/Models/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ class Result extends Model
'created' => ResultCreated::class,
];

/**
* The tag attributes to be passed to influxdb
*/
public function formatTagsForInfluxDB2(): array
{
return [
'server_id' => (int) $this->server_id,
'server_host' => $this->server_host,
'server_name' => $this->server_name,
];
}

/**
* The attributes to be passed to influxdb
*/
Expand Down