Skip to content

Commit

Permalink
dependencies bump + show resources
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinabraham committed Dec 18, 2024
1 parent 3223736 commit fbf5674
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
13 changes: 13 additions & 0 deletions mobsf/MobSF/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ def upstream_proxy(flaw_type):
return proxies, verify


def get_system_resources():
"""Get CPU and Memory Available."""
# Get number of physical cores
physical_cores = psutil.cpu_count(logical=False)
# Get number of logical processors (threads)
logical_processors = psutil.cpu_count(logical=True)
# Get total RAM
total_ram = psutil.virtual_memory().total / (1024 ** 3) # Convert bytes to GB
return physical_cores, logical_processors, total_ram


def print_version():
"""Print MobSF Version."""
logger.info(settings.BANNER)
Expand All @@ -122,6 +133,8 @@ def print_version():
dst_str = f' ({dist}) '
env_str = f'OS Environment: {os}{dst_str}{pltfm}'
logger.info(env_str)
cores, threads, ram = get_system_resources()
logger.info('CPU Cores: %s, Threads: %s, RAM: %.2f GB', cores, threads, ram)
find_java_binary()
check_basic_env()
thread = threading.Thread(target=check_update, name='check_update')
Expand Down
16 changes: 8 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fbf5674

Please sign in to comment.