forked from alexjustesen/speedtest-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestInfluxDB.php
More file actions
46 lines (39 loc) · 1.03 KB
/
TestInfluxDB.php
File metadata and controls
46 lines (39 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace App\Console\Commands;
use App\Models\Result;
use App\Settings\InfluxDbSettings;
use Illuminate\Console\Command;
class TestInfluxDB extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:test-influxdb';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Write a test log to InfluxDB to make sure the config works.';
/**
* Execute the console command.
*
* @return int
*/
public function handle(InfluxDbSettings $settings)
{
$influxdb = [
'enabled' => $settings->v2_enabled,
'url' => optional($settings)->v2_url,
'org' => optional($settings)->v2_org,
'bucket' => optional($settings)->v2_bucket,
'token' => optional($settings)->v2_token,
];
if ($influxdb['enabled'] == true) {
$result = Result::factory()->create();
}
return 0;
}
}