Skip to content
Snippets Groups Projects
Verified Commit 16e1075b authored by David Hoese's avatar David Hoese
Browse files

Change default manual averaging command to all influxdb durations

parent 740b5cb0
No related branches found
No related tags found
No related merge requests found
...@@ -38,10 +38,22 @@ For operational use we currently install InfluxDB as a systemd service: ...@@ -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 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. We'll also need the influx CLI to initalize the database.
https://docs.influxdata.com/influxdb/v2.6/reference/cli/influx/ 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 Setup database
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
...@@ -114,6 +126,15 @@ Change the permissions for these two files to read-only for the metobs user: ...@@ -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_ro.txt
chmod 400 /home/metobs/influxdbv2_metobs_rw.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 Backfill InfluxDB Database
-------------------------- --------------------------
...@@ -127,7 +148,7 @@ at a time. A bulk value of 5000-10000 is preferred. ...@@ -127,7 +148,7 @@ at a time. A bulk value of 5000-10000 is preferred.
Compute the averages for 5 second tower and data: 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) 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 must be at whole intervals for the average intervals specified otherwise
......
...@@ -233,7 +233,7 @@ def main(): ...@@ -233,7 +233,7 @@ def main():
subparser.add_argument('-e', '--end-time', type=_dt_convert, required=True, subparser.add_argument('-e', '--end-time', type=_dt_convert, required=True,
help="End time of data to include in average " help="End time of data to include in average "
"(exclusive). Formats allowed: \'YYYY-MM-DDTHH:MM:SS\'") "(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, choices=DURATIONS,
help="Which average intervals to compute") help="Which average intervals to compute")
subparser.set_defaults(func=run_average_queries) subparser.set_defaults(func=run_average_queries)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment