Updated docs

This commit is contained in:
Walter Dal Mut
2014-09-27 08:35:34 +02:00
parent da3cb0ad16
commit 3e29ff5738
+17 -14
View File
@@ -101,8 +101,8 @@ $client = \InfluxDB\ClientFactory::create($options);
$client->mark("error.404", ["page" => "/a-missing-page"]); $client->mark("error.404", ["page" => "/a-missing-page"]);
``` ```
Of course you can always use the DiC or your service manager in Of course you can always use the DiC or your service manager in order to create
order to create a valid client instance. a valid client instance.
### Time Precision write/read queries ### Time Precision write/read queries
@@ -125,10 +125,11 @@ $influx->query("select * from mine");
$influx->query("select * from mine", "s"); // with time_precision $influx->query("select * from mine", "s"); // with time_precision
``` ```
You can query the database only if the adapter is queryable (implements `QueryableInterface`), You can query the database only if the adapter is queryable (implements
actually `GuzzleAdapter`. `QueryableInterface`), actually `GuzzleAdapter`.
The adapter returns the json decoded body of the InfluxDB response, something like: The adapter returns the json decoded body of the InfluxDB response, something
like:
``` ```
array(1) { array(1) {
@@ -161,9 +162,9 @@ array(1) {
} }
``` ```
By default data is returned as is. You can add filters in order to By default data is returned as is. You can add filters in order to change a
change a response as you prefer, by default this library carries a response as you prefer, by default this library carries a common filter that
common filter that simplifies the response. simplifies the response.
``` ```
$client->setFilter(new ColumnsPointsFilter()); $client->setFilter(new ColumnsPointsFilter());
@@ -171,8 +172,7 @@ $client->setFilter(new ColumnsPointsFilter());
$data = $client->query("select * from hd_used"); $data = $client->query("select * from hd_used");
``` ```
With the "ColumnsPointsFilter" you get a list of dictionaries, With the "ColumnsPointsFilter" you get a list of dictionaries, something like:
something like:
``` ```
[ [
@@ -196,9 +196,10 @@ $client->createDatabase("my.name"); // create a new database with name "my.name"
$client->deleteDatabase("my.name"); // delete an existing database with name "my.name" $client->deleteDatabase("my.name"); // delete an existing database with name "my.name"
``` ```
Actually only queryable adapters can handle databases (implements the `QueryableInterface`) Actually only queryable adapters can handle databases (implements the
`QueryableInterface`)
## Benchmark ## Benchmarks
### Adapters ### Adapters
@@ -212,8 +213,7 @@ Corley\Benchmarks\InfluxDB\AdapterEvent
sendDataUsingUdpAdapter : [1,000 ] [0.0000436344147] [22,917.69026] sendDataUsingUdpAdapter : [1,000 ] [0.0000436344147] [22,917.69026]
``` ```
### Filters
### Filter
Just what append when you apply the `ColumnsPointsFilter` Just what append when you apply the `ColumnsPointsFilter`
@@ -229,3 +229,6 @@ Corley\Benchmarks\InfluxDB\FilterEvent
get1000PointFilteredData: [100 ] [0.0074790692329] [133.70648] get1000PointFilteredData: [100 ] [0.0074790692329] [133.70648]
``` ```
in order to eliminate the http handshake and bandwidth overhead network
operations are completely skipped