After almost 3 years (first commit by @gianarb on Sep 10, 2014) we finally decided to tag this version as our first stable branch 1.0.0 in order to keep stable our project.
In this release we just seal the base implementation and interfaces.
This project is now tested with the latest InfluxDB 1.2.4 branch
Implemented comma, equal sign and space escaping
Fixes minor casing issue on namespace import
Fixes minor casing issue on namespace import
Just removed Zend Framework library support that is not used anymore in v0.9 as v0.8 and fixes the PHPUnit configuration file with a more clear and usable testsuite configuration
./vendor/bin/phpunit --testsuite unit
./vendor/bin/phpunit --testsuite integration
Just removed Zend Framework library support that is not used anymore in v0.8
In order to supports different database related queries like:
We should have to fill the base client InfluxDB\Client with several methods:
public function createDatabase($name) { /* ... */ }
public function deleteDatabase($name) { /* ... */ }
public function getDatabases() { /* ... */ }
public function createRetentionPolicy($name) { /* ... */ }
// ...
As many as InfluxDB prepared queries. Instead of that we drop the database management query from the InfluxDB\Client and add a new layer: InfluxDB\Manager that will support InfluxDB prepared queries.
$manager = new Manager($client);
The manager accepts any query via callables:
$manager->addQuery("queryName", function($arg1, $arg2) {
return sprintf("THIS IS MY QUERY WITH: {$arg1} and {$arg2}");
});
// late in your code:
$manager->queryName(1, 2); // THIS IS MY QUERY WITH: 1 and 2
In order to create and share different database management query, objects can used:
class MyCustomQuery
{
public function __invoke($arg1, $arg2)
{
return sprintf("THIS IS MY QUERY WITH: {$arg1} and {$arg2}");
}
public function __toString()
{
return "myCustomQuery";
}
}
// add it
$manager->addQuery(new MyCustomQuery());
// use it
$manager->myCustomQuery(1, 2);
In order to create a better support for database management e custom query support, we deprecate methods:
getDatabasescreateDatabasedeleteDatabaseand we will remove those methods in v0.9.0 and we will introduce a manager in order to support those features
$manager->addQuery("getExceptionsInMinutes", function($minutes) {
return "SELECT * FROM errors WHERE time > now() - {$minutes}m";
});
//late in your code...
$data = $manager->getExceptionsInMinutes(10);
With the 0.7.* version of this library we cannot read and write data using different network adapters. In particular write using UDP/IP and read data back with HTTP. For that reason we move the library removing network adapters and move the project to readers and writers
With this approach you can combine different techniques for reads and writes.
$reader = new Http\Reader($http, $httpOptions);
$writer = new Udp\Writer($udpOptions);
$client = new Client($reader, $writer);
$client->mark(...); // Use UDP/IP support
$client->query("SELECT * FROM my_serie"); // Use HTTP support
As influxdb now support data type specification for integers, in order to separate those values from float64, this is a very simple solution.
Related to issue #48.
Steps:
setForceIntegersRefactored message to line protocol functions
Actually the message_to_line_protocol function need the options set.
For that reason we have removed the helpers.php functions and moved
those utilities int the AdapterAbstract abstract base class.
InfluxDB integration test environment variable
In order to change the InfluxDB version we have prepared an env variable
in our Travis-CI configuration file .travis.yml
In order to correctly supports boolean types, the library now will send "true" and "false" to Influxdb.
$client->mark("serie", [
"is_valid" => true,
"valve_open" => false,
]);
inline protocol to line protocolThe function message_to_inline_protocol now is renamed to message_to_line_protocol
How can I help you explore Laravel packages today?