Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OSUG
RESIF
resif_data_reporter
Commits
03501d8d
Commit
03501d8d
authored
Aug 22, 2019
by
Jonathan Schaeffer
Browse files
Séparation de channel et qualité
parent
64e05d1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
resifdatareporter/resifdatareporter.py
View file @
03501d8d
...
...
@@ -54,7 +54,8 @@ def scan_volume(path):
if
len
(
path
)
==
4
:
logger
.
debug
(
f
"path :
{
path
}
"
)
logger
.
debug
(
f
"size :
{
size
}
"
)
data
.
append
({
'year'
:
path
[
0
],
'network'
:
path
[
1
],
'station'
:
path
[
2
],
'channel'
:
path
[
3
],
'size'
:
size
})
(
channel
,
quality
)
=
path
[
3
].
split
(
'.'
)
data
.
append
({
'year'
:
path
[
0
],
'network'
:
path
[
1
],
'station'
:
path
[
2
],
'channel'
:
channel
,
'quality'
:
quality
,
'size'
:
size
})
return
data
...
...
@@ -165,9 +166,9 @@ def cli(configfile):
conn
=
psycopg2
.
connect
(
dbname
=
cfg
[
'postgres'
][
'database'
],
user
=
cfg
[
'postgres'
][
'user'
],
host
=
cfg
[
'postgres'
][
'host'
],
password
=
cfg
[
'postgres'
][
'password'
],
port
=
cfg
[
'postgres'
][
'port'
])
cur
=
conn
.
cursor
()
execute_values
(
cur
,
"""INSERT INTO datastats (network, year, station, channel, type, size, is_permanent, date) VALUES %s"""
,
"""INSERT INTO datastats (network, year, station, channel,
quality,
type, size, is_permanent, date) VALUES %s"""
,
statistics
,
"(%(network)s, %(year)s, %(station)s, %(channel)s, %(type)s, %(size)s, %(is_permanent)s, %(date)s)"
)
"(%(network)s, %(year)s, %(station)s, %(channel)s,
%(quality)s,
%(type)s, %(size)s, %(is_permanent)s, %(date)s)"
)
conn
.
commit
()
if
'influxdb'
in
cfg
:
...
...
@@ -183,6 +184,7 @@ def cli(configfile):
"network"
:
stat
[
'network'
],
"station"
:
stat
[
'station'
],
"channel"
:
stat
[
'channel'
],
"quality"
:
stat
[
'quality'
],
"permanent"
:
bool
(
stat
[
'is_permanent'
]),
"type"
:
stat
[
'type'
],
"date"
:
stat
[
'date'
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment