You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.
// create an array of points
$points = array(
new Point(
'test_metric', // name of the measurement
0.64, // the measurement value
['host' => 'server01', 'region' => 'us-west'], // optional tags
['cpucount' => 10], // optional additional fields
1435255849 // Time precision has to be set to seconds!
),
new Point(
'test_metric', // name of the measurement
0.84, // the measurement value
['host' => 'server01', 'region' => 'us-west'], // optional tags
['cpucount' => 10], // optional additional fields
1435255849 // Time precision has to be set to seconds!
)
);
// we are writing unix timestamps, which have a second precision
$result = $database->writePoints($points, Database::PRECISION_SECONDS);
using this code in php, i got a "Fatal error: Class 'Point' not found".
so I wasted a few hours, and found a solution.
"new Point" -> "new InfluxDB\Point"
Plz modify the example code.
thanku.
The text was updated successfully, but these errors were encountered:
What exactly did you do with ""new Point" -> "new InfluxDB\Point" to fix the issue?
Sorry for the noob question
Don't know if you're still looking for an answer but it may help others in the future also. But this....
new Point(
'test_metric', // name of the measurement
0.84, // the measurement value
['host' => 'server01', 'region' => 'us-west'], // optional tags
['cpucount' => 10], // optional additional fields
1435255849 // Time precision has to be set to seconds!
)
Becomes this...
new InfluxDB\Point(
'test_metric', // name of the measurement
0.84, // the measurement value
['host' => 'server01', 'region' => 'us-west'], // optional tags
['cpucount' => 10], // optional additional fields
1435255849 // Time precision has to be set to seconds!
)
Any time you get that class error, stick InfluxDB\ before the class with the error, and it should fix it!
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
hi
i had a problem using "point" example code.
using this code in php, i got a "Fatal error: Class 'Point' not found".
so I wasted a few hours, and found a solution.
"new Point" -> "new InfluxDB\Point"
Plz modify the example code.
thanku.
The text was updated successfully, but these errors were encountered: