Compare commits

..

4 Commits

Author SHA1 Message Date
Lucas Armand 63550d5af3 Actual fix -- MOVED TO TEMPLATE 2025-11-17 10:57:55 -08:00
Lucas Armand 7ec0e11938 add await 2025-11-17 10:46:09 -08:00
Lucas Armand 191fbbfe18 try seek 2025-11-17 10:44:13 -08:00
Lucas Armand 9a4a39c71b Read model log 2025-11-17 10:32:38 -08:00
3 changed files with 4 additions and 8 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ from lib.data_types import (
BenchmarkResult BenchmarkResult
) )
VERSION = "0.2.1" VERSION = "0.2.0"
MSG_HISTORY_LEN = 100 MSG_HISTORY_LEN = 100
log = logging.getLogger(__file__) log = logging.getLogger(__file__)
@@ -431,4 +431,4 @@ class Backend:
if os.path.isfile(self.model_log_file) is True: if os.path.isfile(self.model_log_file) is True:
return await tail_log() return await tail_log()
else: else:
await sleep(1) await asyncio.sleep(1)
+2 -2
View File
@@ -146,7 +146,6 @@ class Metrics:
def _set_mtoken(self, mtoken: str) -> None: def _set_mtoken(self, mtoken: str) -> None:
self.mtoken = mtoken self.mtoken = mtoken
#######################################Private####################################### #######################################Private#######################################
async def __send_delete_requests_and_reset(self): async def __send_delete_requests_and_reset(self):
@@ -217,7 +216,7 @@ class Metrics:
id=self.id, id=self.id,
mtoken=self.mtoken, mtoken=self.mtoken,
version=self.version, version=self.version,
loadtime=(loadtime_snapshot or 0.0), loadtime=(loadtime_snapshot or 0.0),
new_load=self.model_metrics.workload_processing, new_load=self.model_metrics.workload_processing,
cur_load=self.model_metrics.cur_load, cur_load=self.model_metrics.cur_load,
rej_load=self.model_metrics.workload_rejected, rej_load=self.model_metrics.workload_rejected,
@@ -281,6 +280,7 @@ class Metrics:
if sent: if sent:
# clear the one-shot loadtime only if we actually sent *this* value # clear the one-shot loadtime only if we actually sent *this* value
self.system_metrics.reset(expected=loadtime_snapshot)
self.update_pending = False self.update_pending = False
self.model_metrics.reset() self.model_metrics.reset()
self.last_metric_update = time.time() self.last_metric_update = time.time()
-4
View File
@@ -124,9 +124,5 @@ cd "$SERVER_DIR"
echo "launching PyWorker server" echo "launching PyWorker server"
# if instance is rebooted, we want to clear out the log file so pyworker doesn't read lines
# from the run prior to reboot. past logs are saved in $MODEL_LOG.old for debugging only
[ -e "$MODEL_LOG" ] && cat "$MODEL_LOG" >> "$MODEL_LOG.old" && : > "$MODEL_LOG"
(python3 -m "workers.$BACKEND.server" |& tee -a "$PYWORKER_LOG") & (python3 -m "workers.$BACKEND.server" |& tee -a "$PYWORKER_LOG") &
echo "launching PyWorker server done" echo "launching PyWorker server done"