Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MetObsCommon
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MetObs
MetObsCommon
Commits
16e1075b
Verified
Commit
16e1075b
authored
2 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Change default manual averaging command to all influxdb durations
parent
740b5cb0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.rst
+22
-1
22 additions, 1 deletion
README.rst
metobscommon/influxdb.py
+1
-1
1 addition, 1 deletion
metobscommon/influxdb.py
with
23 additions
and
2 deletions
README.rst
+
22
−
1
View file @
16e1075b
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
metobscommon/influxdb.py
+
1
−
1
View file @
16e1075b
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment