Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aura-engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Lars Kruse
aura-engine
Commits
731b1aaf
Commit
731b1aaf
authored
4 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Engine status section.
parent
045e8d86
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
modules/core/monitor.py
+6
-3
6 additions, 3 deletions
modules/core/monitor.py
modules/core/startup.py
+2
-2
2 additions, 2 deletions
modules/core/startup.py
with
8 additions
and
5 deletions
modules/core/monitor.py
+
6
−
3
View file @
731b1aaf
...
...
@@ -25,6 +25,7 @@ import os.path
from
os
import
path
from
enum
import
Enum
import
meta
from
modules.communication.redis.adapter
import
ClientRedisAdapter
...
...
@@ -51,6 +52,7 @@ class Monitoring:
self
.
config
=
config
self
.
soundsystem
=
soundsystem
self
.
status
=
dict
()
self
.
status
[
"
engine
"
]
=
dict
()
self
.
status
[
"
soundsystem
"
]
=
dict
()
self
.
status
[
"
api
"
]
=
dict
()
self
.
status
[
"
api
"
][
"
steering
"
]
=
dict
()
...
...
@@ -62,6 +64,8 @@ class Monitoring:
"""
Requests the current status of all components
"""
self
.
status
[
"
engine
"
][
"
version
"
]
=
meta
.
__version__
self
.
soundsystem
.
enable_transaction
(
self
.
soundsystem
.
client
)
self
.
status
[
"
soundsystem
"
][
"
version
"
]
=
self
.
soundsystem
.
version
()
self
.
status
[
"
soundsystem
"
][
"
active
"
]
=
self
.
soundsystem
.
is_active
()
...
...
@@ -84,11 +88,10 @@ class Monitoring:
self
.
status
[
"
redis_ready
"
]
=
self
.
validate_redis_connection
()
self
.
status
[
"
audio_store
"
]
=
self
.
validate_directory
(
self
.
config
.
get
(
"
audiofolder
"
))
# Set overall status
if
self
.
has_valid_status
():
self
.
status
[
"
engine
_
status
"
]
=
MonitorResponseCode
.
OK
.
value
self
.
status
[
"
engine
"
][
"
status
"
]
=
MonitorResponseCode
.
OK
.
value
else
:
self
.
status
[
"
engine
_
status
"
]
=
MonitorResponseCode
.
INVALID_STATE
.
value
self
.
status
[
"
engine
"
][
"
status
"
]
=
MonitorResponseCode
.
INVALID_STATE
.
value
...
...
This diff is collapsed.
Click to expand it.
modules/core/startup.py
+
2
−
2
View file @
731b1aaf
...
...
@@ -62,8 +62,8 @@ class StartupThread(threading.Thread):
status
=
self
.
monitoring
.
get_status
()
self
.
logger
.
info
(
"
Status Monitor:
\n
%s
"
%
json
.
dumps
(
status
,
indent
=
4
))
if
not
status
[
"
engine
_
status
"
]
==
"
OK
"
:
self
.
logger
.
info
(
"
Engine Status:
"
+
SimpleUtil
.
red
(
status
[
"
engine
_
status
"
]))
if
not
status
[
"
engine
"
][
"
status
"
]
==
"
OK
"
:
self
.
logger
.
info
(
"
Engine Status:
"
+
SimpleUtil
.
red
(
status
[
"
engine
"
][
"
status
"
]))
raise
EngineMalfunctionException
else
:
self
.
logger
.
info
(
"
Engine Status:
"
+
SimpleUtil
.
green
(
"
OK
"
))
...
...
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