diff --git a/README.rst b/README.rst index 5253768653815e860b5637eaa932125f94b5618f..808e19ca97f12236c01fa37b79187c6557a32d58 100644 --- a/README.rst +++ b/README.rst @@ -38,10 +38,22 @@ For operational use we currently install InfluxDB as a systemd service: https://docs.influxdata.com/influxdb/v2.6/install/?t=Linux#install-influxdb-as-a-service-with-systemd +At the time of writing this would include: + +```bash +sudo yum install influxdb2 +``` + We'll also need the influx CLI to initalize the database. https://docs.influxdata.com/influxdb/v2.6/reference/cli/influx/ +At the time of writing this would include: + +```bash +sudo yum install influxdb2-cli +``` + Setup database ^^^^^^^^^^^^^^ @@ -114,6 +126,15 @@ Change the permissions for these two files to read-only for the metobs user: chmod 400 /home/metobs/influxdbv2_metobs_ro.txt chmod 400 /home/metobs/influxdbv2_metobs_rw.txt +Create recurring Tasks +---------------------- + +Install averaging tasks to create average fields in the metobs_realtime bucket: + +.. code-block:: bash + + python -m metobscommon.influxdb create_tasks + Backfill InfluxDB Database -------------------------- @@ -127,7 +148,7 @@ at a time. A bulk value of 5000-10000 is preferred. Compute the averages for 5 second tower and data: - python -m metobscommon.influxdb -vvv run_manual_cqs --symbol-list aosstower.level_00.influxdb.SYMBOLS --stations aoss.tower -s 2018-05-07T00:00:00 -e 2018-05-08T22:00:00 -d 1m 5m 1h + python -m metobscommon.influxdb -vvv run_manual_average --stations aoss.tower -s 2018-05-07T00:00:00 -e 2018-05-08T22:00:00 -d 1m 5m 1h Note the above computes the 1m, 5m, and 1h averages. The time range (-s/-e) must be at whole intervals for the average intervals specified otherwise diff --git a/metobscommon/influxdb.py b/metobscommon/influxdb.py index e046d9a3b95b08d26e66a17efceec4c69b7555fd..398b3515816296131cfeeaaf336fbbf2c6f90949 100644 --- a/metobscommon/influxdb.py +++ b/metobscommon/influxdb.py @@ -233,7 +233,7 @@ def main(): subparser.add_argument('-e', '--end-time', type=_dt_convert, required=True, help="End time of data to include in average " "(exclusive). Formats allowed: \'YYYY-MM-DDTHH:MM:SS\'") - subparser.add_argument('-d', '--durations', nargs='+', default=['1m'], + subparser.add_argument('-d', '--durations', nargs='+', default=DURATIONS, choices=DURATIONS, help="Which average intervals to compute") subparser.set_defaults(func=run_average_queries)