Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ dependencies:
- captcha==0.5.0
- pyopenms_viz==1.0.0
- streamlit-js-eval
- psutil==7.0.0
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ plotly==5.22.0
captcha==0.5.0
pyopenms_viz==1.0.0
streamlit-js-eval
psutil==7.0.0
19 changes: 17 additions & 2 deletions src/common/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import streamlit as st
import pandas as pd

import psutil
try:
from tkinter import Tk, filedialog

Expand All @@ -23,6 +23,18 @@
# Detect system platform
OS_PLATFORM = sys.platform

@st.fragment(run_every=5)
def monitor_hardware():
cpu_progress = psutil.cpu_percent(interval=None) / 100
ram_progress = 1 - psutil.virtual_memory().available / psutil.virtual_memory().total

st.text(f"Ram ({ram_progress * 100:.2f}%)")
st.progress(ram_progress)

st.text(f"CPU ({cpu_progress * 100:.2f}%)")
st.progress(cpu_progress)

st.caption(f"Last fetched at: {time.strftime('%H:%M:%S')}")

def load_params(default: bool = False) -> dict[str, Any]:
"""
Expand Down Expand Up @@ -211,7 +223,7 @@ def page_setup(page: str = "") -> dict[str, Any]:
if st.session_state.settings["workspaces_dir"] and st.session_state.location == "local":
workspaces_dir = Path(st.session_state.settings["workspaces_dir"], "workspaces-" + st.session_state.settings["repository-name"])
else:
workspace_dir = '..'
workspaces_dir = '..'

# Check if workspace logic is enabled
if st.session_state.settings["enable_workspaces"]:
Expand Down Expand Up @@ -348,6 +360,9 @@ def change_workspace():
)
else:
st.session_state["spectrum_num_bins"] = 50

with st.expander("📊 **Resource Utilization**"):
monitor_hardware()

# Display OpenMS WebApp Template Version from settings.json
with st.container():
Expand Down
Loading