Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AossTower
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Monitor
Incidents
Analyze
Value stream analytics
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
AossTower
Commits
ea2b5738
Verified
Commit
ea2b5738
authored
2 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Switch to metobscommon influxdb_conn_params
parent
a5a38865
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aosstower/level_00/influxdb.py
+4
-5
4 additions, 5 deletions
aosstower/level_00/influxdb.py
with
4 additions
and
5 deletions
aosstower/level_00/influxdb.py
+
4
−
5
View file @
ea2b5738
...
...
@@ -217,7 +217,7 @@ def main():
ldmp_tables
=
args
.
tables
,
tail_file
=
args
.
tail
,
)
influxdb_conn_params
=
{
"
host
"
:
args
.
host
,
"
port
"
:
args
.
port
,
"
dbname
"
:
args
.
dbname
}
influxdb_conn_params
=
influxdb
.
convert_influxdb_args_to_kwargs
(
args
)
try
:
influx_gen
=
convert_to_influx_frame
(
record_gen
,
symbols
,
args
.
debug
)
influx_gen
=
influxdb
.
grouper
(
influx_gen
,
args
.
bulk
)
...
...
@@ -233,12 +233,14 @@ def main():
except
(
RuntimeError
,
ValueError
,
KeyError
,
requests
.
RequestException
):
if
hasattr
(
record_gen
,
"
close
"
):
record_gen
.
close
()
raise
def
_create_arg_parser
():
import
argparse
parser
=
argparse
.
ArgumentParser
(
description
=
__doc__
,
formatter_class
=
argparse
.
ArgumentDefaultsHelpFormatter
)
influxdb
.
add_influxdb_command_line_arguments
(
parser
)
parser
.
add_argument
(
"
--logfn
"
,
help
=
"
Log to rotating file (Not Implemented)
"
)
parser
.
add_argument
(
"
--debug
"
,
...
...
@@ -260,9 +262,6 @@ def _create_arg_parser():
help
=
"
Treat `src` file as a station name and read records from LoggerNet LDMP server (port: 1024)
"
,
)
parser
.
add_argument
(
"
--tables
"
,
nargs
=
"
*
"
,
default
=
[
"
1
"
],
help
=
"
LoggerNet LDMP tables to read in
"
)
parser
.
add_argument
(
"
--host
"
,
default
=
influxdb
.
DB_HOST
,
help
=
"
Hostname of database connection
"
)
parser
.
add_argument
(
"
--port
"
,
default
=
influxdb
.
DB_PORT
,
help
=
"
Port of database connection
"
)
parser
.
add_argument
(
"
--dbname
"
,
default
=
influxdb
.
DB_NAME
,
help
=
"
Name of database to modify
"
)
parser
.
add_argument
(
"
-s
"
,
"
--station
"
,
...
...
@@ -328,7 +327,7 @@ def _ingest_loggernet_to_influxdb_and_weatherunderground(
for
record
in
influx_gen
:
if
not
debug
:
lines
=
influxdb
.
frame_records
(
record
,
**
station_tags
)
influxdb
.
insert
(
lines
,
**
influxdb_conn_params
)
influxdb
.
insert
(
lines
,
influxdb_conn_params
)
if
not
debug
and
not
wu_pw
:
# we don't plan on doing anything with averaged weatherunderground uploads
...
...
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