From 66c42acec7036492f7d19dd55d83e8d291de83b3 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Sat, 13 Sep 2014 11:42:44 +0200 Subject: [PATCH] Updated docs with factory method --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 59068ea0c..2c19815cc 100644 --- a/README.md +++ b/README.md @@ -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