Skip to content

Commit 4deda84

Browse files
committed
feat: log cpu count and memory info of the system
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
1 parent 4de591f commit 4deda84

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
# SPDX-License-Identifier: AGPL-3.0-or-later
55
#
66
import logging
7-
from os import getenv
7+
from os import cpu_count, getenv
88

9+
import psutil
910
import uvicorn
1011
from nc_py_api.ex_app import run_app
1112

@@ -48,6 +49,7 @@ def _setup_log_levels(debug: bool):
4849
app_config: TConfig = app.extra['CONFIG']
4950
_setup_log_levels(app_config.debug)
5051

52+
print(f'CPU count: {cpu_count()}, Memory: {psutil.virtual_memory()}')
5153
print('App config:\n' + redact_config(app_config).model_dump_json(indent=2), flush=True)
5254

5355
uv_log_config = uvicorn.config.LOGGING_CONFIG # pyright: ignore[reportAttributeAccessIssue]

0 commit comments

Comments
 (0)