Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #103 from NickBusey/patch-1
Browse files Browse the repository at this point in the history
Adding timeout information.
  • Loading branch information
gianarb committed May 24, 2018
2 parents a66475b + 2a4a234 commit 4b8a0c9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $database = InfluxDB\Client::fromDSN(sprintf('influxdb://user:pass@%s:%s/%s', $h
$client = $database->getClient();
```

### Reading
### Reading data

To fetch records from InfluxDB you can do a query directly on a database:

Expand Down Expand Up @@ -90,6 +90,15 @@ $lastQuery = $client->getLastQuery();
$lastQuery = Client::lastQuery;
```

### Reading data using a timeout

In production if you are querying InfluxDB to generate a response to a web or API request, you may want to set a specific timeout for InfluxDB calls rather than the default of letting them run indefinitely.

```php
// Fetch the database using a 5 second time out
$database = InfluxDB\Client::fromDSN(sprintf('influxdb://user:pass@%s:%s/%s', $host, $port, $dbname), 5);
```

### Writing data

Writing data is done by providing an array of points to the writePoints method on a database:
Expand Down

0 comments on commit 4b8a0c9

Please sign in to comment.