-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'interuss/main' into scd0100
- Loading branch information
Showing
33 changed files
with
235 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from datetime import timedelta | ||
import time | ||
from typing import Union | ||
|
||
from loguru import logger | ||
|
||
|
||
MAX_SILENT_DELAY_S = 0.4 | ||
"""Number of seconds to delay above which a reasoning message should be displayed.""" | ||
|
||
|
||
def sleep(duration: Union[float, timedelta], reason: str) -> None: | ||
"""Sleep for the specified amount of time, logging the fact that the delay is occurring (when appropriate). | ||
Args: | ||
duration: Amount of time to sleep for; interpreted as seconds if float. | ||
reason: Reason the delay is happening (to be printed to console/log if appropriate). | ||
""" | ||
if isinstance(duration, timedelta): | ||
duration = duration.total_seconds() | ||
if duration <= 0: | ||
# No need to delay | ||
return | ||
|
||
if duration > MAX_SILENT_DELAY_S: | ||
logger.debug(f"Delaying {duration:.1f} seconds because {reason}") | ||
time.sleep(duration) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
monitoring/uss_qualifier/reports/templates/sequence_view/severity.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% macro severity_symbol(s) %} | ||
{% if s == Severity.Low %} | ||
ℹ️ | ||
{% elif s == Severity.Medium %} | ||
⚠️ | ||
{% elif s == Severity.High %} | ||
🛑 | ||
{% elif s == Severity.Critical %} | ||
☢️ | ||
{% else %} | ||
? | ||
{% endif %} | ||
{% endmacro %} | ||
|
||
{% macro severity_class(s) %} | ||
{% if s == Severity.Low %} | ||
info_result | ||
{% else %} | ||
fail_result | ||
{% endif %} | ||
{% endmacro %} |
Oops, something went wrong.