hungernet-oxide 1.dev16__tar.gz → 1.dev17__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hungernet_oxide-1.dev16/src/hungernet_oxide.egg-info → hungernet_oxide-1.dev17}/PKG-INFO +1 -1
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/pyproject.toml +1 -1
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17/src/hungernet_oxide.egg-info}/PKG-INFO +1 -1
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/app.py +11 -8
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/configclasses/logging.py +2 -2
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/defaultconfigs/logging.yaml +2 -1
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/router.py +4 -1
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/LICENSE +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/README.md +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/setup.cfg +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/SOURCES.txt +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/dependency_links.txt +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/entry_points.txt +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/requires.txt +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/top_level.txt +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/__init__.py +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/__main__.py +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/actionperformer.py +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/configclasses/__init__.py +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/configclasses/config.py +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/configclasses/evaluation.py +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/configclasses/messages.py +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/configclasses/watcher.py +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/connection.py +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/defaultconfigs/config.yaml +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/defaultconfigs/evaluation.yaml +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/defaultconfigs/messages.yaml +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/defaultconfigs/watcher.yaml +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/evaluator.py +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/metricfetcher.py +0 -0
- {hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/settings.py +0 -0
|
@@ -75,24 +75,27 @@ class Oxide:
|
|
|
75
75
|
return 'schedule_restart', settings.watcher.high_gap_minutes
|
|
76
76
|
|
|
77
77
|
def run(self):
|
|
78
|
+
print('Oxide is running!')
|
|
79
|
+
if settings.logging.enable_terminal_clearing:
|
|
80
|
+
utils.clear()
|
|
81
|
+
|
|
78
82
|
try:
|
|
79
83
|
self.startup()
|
|
80
|
-
self.router.info('Oxide is running!')
|
|
81
84
|
self.notifyWebhook('oxide_started')
|
|
82
|
-
if settings.logging.enable_terminal_clearing:
|
|
83
|
-
utils.clear()
|
|
84
85
|
except CalagoAPIError as error:
|
|
85
|
-
logger.
|
|
86
|
+
logger.fatal('Oxide startup failed: %s', error)
|
|
86
87
|
logger.error('Update the required values in %s/config.yaml and restart.', settings.config_dir)
|
|
87
88
|
raise SystemExit(1) from None
|
|
88
89
|
|
|
89
90
|
try:
|
|
90
91
|
while True:
|
|
92
|
+
self.router.debug('Collecting server metrics.')
|
|
91
93
|
metrics = self.fetcher.snapshot(
|
|
92
94
|
duration=settings.evaluation.sample_duration,
|
|
93
95
|
interval=settings.evaluation.sample_interval,
|
|
94
96
|
drop_outliers=settings.evaluation.sample_outlier_drop,
|
|
95
97
|
)
|
|
98
|
+
self.router.debug(f'Metrics snapshot: {metrics!r}')
|
|
96
99
|
|
|
97
100
|
missing = [name for name in ('ram_gib', 'cpu_percent', 'uptime_seconds', 'tps', 'players')
|
|
98
101
|
if metrics[name] is None]
|
|
@@ -103,6 +106,7 @@ class Oxide:
|
|
|
103
106
|
continue
|
|
104
107
|
|
|
105
108
|
result = self.evaluator.evaluate(metrics)
|
|
109
|
+
self.router.debug(f'Evaluation result: {result!r}')
|
|
106
110
|
|
|
107
111
|
if result['reasons']:
|
|
108
112
|
self.router.warn('Evaluation flags:')
|
|
@@ -110,17 +114,16 @@ class Oxide:
|
|
|
110
114
|
self.router.warn('- ' + reason)
|
|
111
115
|
|
|
112
116
|
action, minutes = self.decideAction(result, metrics)
|
|
117
|
+
self.router.debug(f'Selected action: {action!r}; delay: {minutes!r}')
|
|
113
118
|
self.action.perform(action, minutes=minutes)
|
|
114
119
|
|
|
115
120
|
time.sleep(settings.watcher.watch_interval)
|
|
116
121
|
except Exception as error:
|
|
117
122
|
self.notifyWebhook('unexpectedError', error=str(error))
|
|
123
|
+
self.router.fatal(f'Oxide stopped after an unexpected error: {error}')
|
|
118
124
|
raise
|
|
119
125
|
except KeyboardInterrupt:
|
|
120
|
-
|
|
121
|
-
self.router.info(settings.messages.shutdown)
|
|
122
|
-
else:
|
|
123
|
-
raise
|
|
126
|
+
self.router.info(settings.messages.shutdown)
|
|
124
127
|
finally:
|
|
125
128
|
if self.server is not None:
|
|
126
129
|
self.server.closeBridge()
|
|
@@ -15,6 +15,6 @@ class LoggingConfig:
|
|
|
15
15
|
fatal_prefix: str = 'prefixes.fatal'
|
|
16
16
|
|
|
17
17
|
enable_terminal_clearing: bool = 'terminal.enable_clearing'
|
|
18
|
-
handle_keyboard_interrupt: bool = 'terminal.handle_keyboard_interrupt'
|
|
19
18
|
|
|
20
|
-
timezone: str = 'timezone'
|
|
19
|
+
timezone: str = 'timezone'
|
|
20
|
+
debug: bool = 'debug'
|
|
@@ -63,7 +63,10 @@ class Router:
|
|
|
63
63
|
self.warn = self.router.warn
|
|
64
64
|
self.error = self.router.error
|
|
65
65
|
self.fatal = self.router.fatal
|
|
66
|
-
self.debug = self.router.debug
|
|
67
66
|
self.broadcast = self.router.broadcast
|
|
68
67
|
self.origin = self.router.origin
|
|
69
68
|
self.destination = self.router.destination
|
|
69
|
+
|
|
70
|
+
def debug(self, text, **context):
|
|
71
|
+
if self.logging.debug:
|
|
72
|
+
self.router.debug(text, **context)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/requires.txt
RENAMED
|
File without changes
|
{hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hungernet_oxide-1.dev16 → hungernet_oxide-1.dev17}/src/oxide/defaultconfigs/evaluation.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|