/**
* Writes points into InfluxDB
*
* @param Point[] $points Array of points
* @param string $precision The timestamp precision (defaults to nanoseconds)
*
* @return bool
* @throws Exception
*/
public function writePoints(array $points, $precision = self::PRECISION_NANOSECONDS)
{
$payload = array();
foreach ($points as $point) {
if (!$point instanceof Point) {
throw new \InvalidArgumentException('An array of Point[] should be passed');
}
$payload[] = (string) $point;
}
return $this->client->write($this->name, implode(PHP_EOL, $payload), $precision);
}