Until now we've always converted individual metrics entries to a dictionary, which then was fed to the InfluxDB client (either alone or in an array of entries/dictionaries) to write it to InfluxDB (with the write method).
This strategy is not really suitable for processes that generate metrics at a very high rate (e.g. LabJack), as this conversion takes too long. Instead of write (to dump a dictionary/point or an array thereof), you can also use write_dataframe (to dump an entire pandas DataFrame in one go):
metrics.client.write_dataframe(
df=df,
measurement=ORIGIN.lower(),
)
Until now we've always converted individual metrics entries to a dictionary, which then was fed to the InfluxDB client (either alone or in an array of entries/dictionaries) to write it to InfluxDB (with the
writemethod).This strategy is not really suitable for processes that generate metrics at a very high rate (e.g. LabJack), as this conversion takes too long. Instead of
write(to dump a dictionary/point or an array thereof), you can also usewrite_dataframe(to dump an entirepandas DataFramein one go):