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
Melodic
morphemic-preprocessor
Commits
eaa4be38
Commit
eaa4be38
authored
Jun 07, 2021
by
Anna Warno
Browse files
timestamp format changed seconds -> miliseconds
parent
cc5b6cf2
Changes
5
Hide whitespace changes
Inline
Side-by-side
deployment/nbeats/main.py
View file @
eaa4be38
...
...
@@ -94,8 +94,8 @@ def main():
# msg2 = Msg()
# msg2.body = """{
# "metrics": ["cpu_usage"],
# "timestamp":
0
,
# "epoch_start":
0
,
# "timestamp":
1623057648907
,
# "epoch_start":
1623057698298
,
# "number_of_forward_predictions": 5,
# "prediction_horizon": 120}"""
...
...
deployment/nbeats/predict.py
View file @
eaa4be38
...
...
@@ -48,7 +48,6 @@ class CustomListener(stomp.ConnectionListener):
metrics
=
set
(
json
.
loads
(
frame
.
body
)[
"metrics"
])
if
self
.
start
:
print
(
"STARTTTTTT"
,
self
.
start
)
predicted_metrics
=
predicted_metrics
.
union
(
metrics
)
for
metric
in
metrics
:
frame_body
=
json
.
loads
(
frame
.
body
)
...
...
@@ -87,11 +86,13 @@ def main():
influxdb_conn
=
InfluxdbPredictionsSender
(
METHOD
,
APP_NAME
)
logging
.
debug
(
f
"waiting
{
msg
[
'epoch_start'
]
-
int
(
time
.
time
())
-
prediction_cycle
}
seconds"
f
"waiting
{
(
msg
[
'epoch_start'
]
-
int
(
time
.
time
())
*
1000
-
prediction_cycle
*
1000
)
//
1000
}
seconds"
)
print
(
"waiting: "
,
msg
[
"epoch_start"
]
-
int
(
time
.
time
())
-
prediction_cycle
)
time
.
sleep
(
max
(
0
,
msg
[
"epoch_start"
]
-
int
(
time
.
time
())
-
prediction_cycle
))
time
.
sleep
(
max
(
0
,
(
msg
[
"epoch_start"
]
-
int
(
time
.
time
())
*
1000
-
prediction_cycle
*
1000
))
//
1000
)
tl
=
Timeloop
()
...
...
deployment/nbeats/src/model_train.py
View file @
eaa4be38
...
...
@@ -91,7 +91,7 @@ def train(target_column, yaml_file="nbeats.yaml"):
msg
=
{
"metrics"
:
target_column
,
"forecasting_method"
:
os
.
environ
.
get
(
"METHOD"
,
"nbetas"
),
"timestamp"
:
time
.
time
(),
"timestamp"
:
int
(
time
.
time
()
)
*
1000
,
}
print
(
msg
)
return
msg
deployment/tft/predict.py
View file @
eaa4be38
...
...
@@ -48,7 +48,6 @@ class CustomListener(stomp.ConnectionListener):
metrics
=
set
(
json
.
loads
(
frame
.
body
)[
"metrics"
])
if
self
.
start
:
print
(
"STARTTTTTT"
,
self
.
start
)
predicted_metrics
=
predicted_metrics
.
union
(
metrics
)
for
metric
in
metrics
:
frame_body
=
json
.
loads
(
frame
.
body
)
...
...
@@ -87,11 +86,13 @@ def main():
influxdb_conn
=
InfluxdbPredictionsSender
(
METHOD
,
APP_NAME
)
logging
.
debug
(
f
"waiting
{
msg
[
'epoch_start'
]
-
int
(
time
.
time
())
-
prediction_cycle
}
seconds"
f
"waiting
{
(
msg
[
'epoch_start'
]
-
int
(
time
.
time
())
*
1000
-
prediction_cycle
*
1000
)
//
1000
}
seconds"
)
print
(
"waiting: "
,
msg
[
"epoch_start"
]
-
int
(
time
.
time
())
-
prediction_cycle
)
time
.
sleep
(
max
(
0
,
msg
[
"epoch_start"
]
-
int
(
time
.
time
())
-
prediction_cycle
))
time
.
sleep
(
max
(
0
,
(
msg
[
"epoch_start"
]
-
int
(
time
.
time
())
*
1000
-
prediction_cycle
*
1000
))
//
1000
)
tl
=
Timeloop
()
...
...
deployment/tft/src/model_train.py
View file @
eaa4be38
...
...
@@ -95,7 +95,7 @@ def train(target_column, prediction_length, yaml_file="model.yaml"):
msg
=
{
"metrics"
:
target_column
,
"forecasting_method"
:
os
.
environ
.
get
(
"METHOD"
,
"tft"
),
"timestamp"
:
int
(
time
.
time
()),
"timestamp"
:
int
(
time
.
time
())
*
1000
,
}
return
msg
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