Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ProfiT-HPC
aggregator
Commits
e50ca427
Commit
e50ca427
authored
Sep 10, 2019
by
Azat Khuziyakhmetov
Browse files
bug fix
parent
2fbfb780
Changes
1
Hide whitespace changes
Inline
Side-by-side
postexec/exportjobinfo.py
View file @
e50ca427
...
...
@@ -249,10 +249,10 @@ def format_influxdb_alloc(job_id, alloc_info, cur_time):
for
node_name
,
alloc_cu
in
alloc_info
.
items
():
req
+=
"{:s},jobid={:s} "
.
format
(
mname
,
job_id
)
req
+=
"node_name=
{}
,"
.
format
(
node_name
)
req
+=
"node_name=
\"
{}
\"
,"
.
format
(
node_name
)
req
+=
"alloc_cu={}"
.
format
(
alloc_cu
)
req
+=
" {:d}
;
"
.
format
(
cur_time
)
req
+=
" {:d}
\n
"
.
format
(
cur_time
)
return
req
...
...
@@ -264,7 +264,7 @@ def format_influx_db_out(job_id, job_data, alloc_data):
req
+=
","
.
join
(
format_fields
(
k
,
v
,
_info
)
for
k
,
v
in
job_data
.
items
())
req
+=
" {:d}
;
"
.
format
(
cur_time
)
req
+=
" {:d}
\n
"
.
format
(
cur_time
)
alloc_influx
=
format_influxdb_alloc
(
job_id
,
alloc_data
,
cur_time
)
...
...
@@ -318,7 +318,6 @@ def export_job_info(job_id):
job_info
,
alloc_info
=
fetch_job_data
(
job_id
)
fdata
=
format_influx_db_out
(
job_id
,
job_info
,
alloc_info
)
payload
=
{
'db'
:
confdb
.
IDB
[
"database"
],
'precision'
:
's'
}
write_url
=
"{:s}/write"
.
format
(
confdb
.
IDB
[
"api_url"
])
...
...
@@ -327,6 +326,6 @@ def export_job_info(job_id):
params
=
payload
,
data
=
fdata
)
if
r
.
status_code
!=
204
:
r
eturn
r
.
status_code
r
aise
ValueError
(
"Couldn't write to InfluxDB"
,
r
.
status_code
,
r
.
content
)
return
True
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment