mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
Updated docs with factory method
This commit is contained in:
@@ -53,6 +53,31 @@ $client = new Client();
|
||||
$client->setAdapter($adapter);
|
||||
```
|
||||
|
||||
### Create your client with the factory method
|
||||
|
||||
Effectively the client creation is not so simple, for that
|
||||
reason you can you the factory method provided with the library.
|
||||
|
||||
```
|
||||
$options = [
|
||||
"adapter" => [
|
||||
"name" => "InfluxDB\\Adapter\\GuzzleAdapter",
|
||||
"options" => [
|
||||
// guzzle options
|
||||
],
|
||||
],
|
||||
"options" => [
|
||||
"host" => "my.influx.domain.tld",
|
||||
],
|
||||
];
|
||||
$client = \InfluxDB\ClientFactory::create($options);
|
||||
|
||||
$client->mark("error.404", ["page" => "/a-missing-page"]);
|
||||
```
|
||||
|
||||
Of course you can always use the DiC or your service manager in
|
||||
order to create a valid client instance.
|
||||
|
||||
### Time Precision write/read queries
|
||||
|
||||
You can set the `time_precision` for query query
|
||||
|
||||
Reference in New Issue
Block a user