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

Adding timeout information. #103

Merged
merged 1 commit into from
May 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is just to be more consistent with the terms below where it says 'Writing data' not just 'Writing'


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