hungernet-oxide 1.dev15__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.dev15/src/hungernet_oxide.egg-info → hungernet_oxide-1.dev17}/PKG-INFO +1 -1
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/pyproject.toml +1 -1
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17/src/hungernet_oxide.egg-info}/PKG-INFO +1 -1
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/app.py +12 -8
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/configclasses/logging.py +2 -2
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/defaultconfigs/logging.yaml +2 -1
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/router.py +4 -1
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/LICENSE +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/README.md +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/setup.cfg +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/SOURCES.txt +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/dependency_links.txt +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/entry_points.txt +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/requires.txt +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/top_level.txt +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/__init__.py +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/__main__.py +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/actionperformer.py +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/configclasses/__init__.py +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/configclasses/config.py +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/configclasses/evaluation.py +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/configclasses/messages.py +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/configclasses/watcher.py +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/connection.py +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/defaultconfigs/config.yaml +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/defaultconfigs/evaluation.yaml +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/defaultconfigs/messages.yaml +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/defaultconfigs/watcher.yaml +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/evaluator.py +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/metricfetcher.py +0 -0
- {hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/oxide/settings.py +0 -0
|
@@ -75,23 +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.
|
|
81
|
-
if settings.logging.enable_terminal_clearing:
|
|
82
|
-
utils.clear()
|
|
84
|
+
self.notifyWebhook('oxide_started')
|
|
83
85
|
except CalagoAPIError as error:
|
|
84
|
-
logger.
|
|
86
|
+
logger.fatal('Oxide startup failed: %s', error)
|
|
85
87
|
logger.error('Update the required values in %s/config.yaml and restart.', settings.config_dir)
|
|
86
88
|
raise SystemExit(1) from None
|
|
87
89
|
|
|
88
90
|
try:
|
|
89
91
|
while True:
|
|
92
|
+
self.router.debug('Collecting server metrics.')
|
|
90
93
|
metrics = self.fetcher.snapshot(
|
|
91
94
|
duration=settings.evaluation.sample_duration,
|
|
92
95
|
interval=settings.evaluation.sample_interval,
|
|
93
96
|
drop_outliers=settings.evaluation.sample_outlier_drop,
|
|
94
97
|
)
|
|
98
|
+
self.router.debug(f'Metrics snapshot: {metrics!r}')
|
|
95
99
|
|
|
96
100
|
missing = [name for name in ('ram_gib', 'cpu_percent', 'uptime_seconds', 'tps', 'players')
|
|
97
101
|
if metrics[name] is None]
|
|
@@ -102,6 +106,7 @@ class Oxide:
|
|
|
102
106
|
continue
|
|
103
107
|
|
|
104
108
|
result = self.evaluator.evaluate(metrics)
|
|
109
|
+
self.router.debug(f'Evaluation result: {result!r}')
|
|
105
110
|
|
|
106
111
|
if result['reasons']:
|
|
107
112
|
self.router.warn('Evaluation flags:')
|
|
@@ -109,17 +114,16 @@ class Oxide:
|
|
|
109
114
|
self.router.warn('- ' + reason)
|
|
110
115
|
|
|
111
116
|
action, minutes = self.decideAction(result, metrics)
|
|
117
|
+
self.router.debug(f'Selected action: {action!r}; delay: {minutes!r}')
|
|
112
118
|
self.action.perform(action, minutes=minutes)
|
|
113
119
|
|
|
114
120
|
time.sleep(settings.watcher.watch_interval)
|
|
115
121
|
except Exception as error:
|
|
116
122
|
self.notifyWebhook('unexpectedError', error=str(error))
|
|
123
|
+
self.router.fatal(f'Oxide stopped after an unexpected error: {error}')
|
|
117
124
|
raise
|
|
118
125
|
except KeyboardInterrupt:
|
|
119
|
-
|
|
120
|
-
self.router.info(settings.messages.shutdown)
|
|
121
|
-
else:
|
|
122
|
-
raise
|
|
126
|
+
self.router.info(settings.messages.shutdown)
|
|
123
127
|
finally:
|
|
124
128
|
if self.server is not None:
|
|
125
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.dev15 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{hungernet_oxide-1.dev15 → hungernet_oxide-1.dev17}/src/hungernet_oxide.egg-info/requires.txt
RENAMED
|
File without changes
|
{hungernet_oxide-1.dev15 → 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.dev15 → 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
|