agrif / OctoPrint-InfluxDB

Writes temperatures and events to an Influx database.
GNU Affero General Public License v3.0
24 stars 15 forks source link

Added support for passing a retention policy for measurements #19

Closed directionalpad closed 4 years ago

directionalpad commented 4 years ago

Implemented the ability to pass a retention policy for measurements being sent to InfluxDB.

The functionality added will use the default retention policy value of "None" when no retention policy value is specified retaining the normal behavior of the plugin. The functionality will not create the retention policy if it does not exist. The retention policy must be created on the database before setting a value on the plugin settings page. As it stands I opted to not to have it create retention policies automatically as everyone will have different needs behind what their retention policy should be.

The plugin was tested against OctoPrint 1.4.2 and Python 2.7.16 running on a Raspberry Pi 4 GB model. The InfluxDB server was running version 1.8.

The installation method used was the command below:

# /home/pi/oprint/bin/python -m pip --disable-pip-version-check install --no-cache-dir https://github.com/directionalpad/OctoPrint-InfluxDB/archive/feature/retention_policies.zip

Feedback and criticism are welcome on this merge request.

agrif commented 4 years ago

Looks good to me. I've merged this and released 1.3.2. Thanks!