Skip to content

Metrics hub should be able to store pandas DataFrame objects #319

@SaraRegibo

Description

@SaraRegibo

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(),
            )

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions