summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolargo <nicolas@nicolargo.com>2021-05-29 18:48:27 +0200
committernicolargo <nicolas@nicolargo.com>2021-05-29 18:48:27 +0200
commit39631d0b097318f2463d06e56b6dcf07e68de775 (patch)
tree6238271baacddd7c09d1983d5a280033dd80b8b8
parent190defc43052c6baaf0e62176931f8b3b998961f (diff)
Add profiling tools
-rw-r--r--Makefile39
-rw-r--r--dev-requirements.txt1
-rw-r--r--doc-requirements.txt (renamed from docs/doc-requirements.txt)0
3 files changed, 27 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 1e274ece..14cf8284 100644
--- a/Makefile
+++ b/Makefile
@@ -3,36 +3,49 @@ PORT?=8008
install:
sensible-browser "https://github.com/nicolargo/glances#installation"
-test:
- ./unitest-all.sh
-
-docs:
- cd docs && ./build.sh
+venv-python:
+ virtualenv -p /usr/bin/python3 venv
-docs-server: docs
- (sleep 2 && sensible-browser "http://localhost:$(PORT)") &
- cd docs/_build/html/ && ./venv/bin/python -m SimpleHTTPServer $(PORT)
+venv-dev:
+ ./venv/bin/pip install -r dev-requirements.txt
+ ./venv/bin/pip install -r doc-requirements.txt
-webui:
- cd glances/outputs/static/ && npm install && npm audit fix && npm run build
+venv-dev-upgrade:
+ ./venv/bin/pip install --upgrade -r dev-requirements.txt
+ ./venv/bin/pip install --upgrade -r doc-requirements.txt
venv:
- virtualenv -p /usr/bin/python3 venv
- ./venv/bin/pip install -r ./docs/doc-requirements.txt
./venv/bin/pip install -r requirements.txt
./venv/bin/pip install -r optional-requirements.txt
venv-upgrade:
- ./venv/bin/pip install --upgrade -r ./docs/doc-requirements.txt
+ ./venv/bin/pip install --upgrade -r dev-requirements.txt
./venv/bin/pip install --upgrade -r requirements.txt
./venv/bin/pip install --upgrade -r optional-requirements.txt
+test:
+ ./unitest-all.sh
+
+docs: venv-dev
+ cd docs && ./build.sh
+
+docs-server: docs
+ (sleep 2 && sensible-browser "http://localhost:$(PORT)") &
+ cd docs/_build/html/ && ./venv/bin/python -m SimpleHTTPServer $(PORT)
+
+webui: venv-dev
+ cd glances/outputs/static/ && npm install && npm audit fix && npm run build
+
run: venv
./venv/bin/python -m glances -C ./conf/glances.conf
run-debug: venv
./venv/bin/python -m glances -C ./conf/glances.conf -d
+run-profiling: venv venv-dev
+ @echo "Please complete and run: sudo ./venv/bin/py-spy record --pid <GLANCES PID> -o /tmp/glances.svg -d 60 -s "
+
+
run-webserver: venv
./venv/bin/python -m glances -C ./conf/glances.conf -w
diff --git a/dev-requirements.txt b/dev-requirements.txt
new file mode 100644
index 00000000..36d32c66
--- /dev/null
+++ b/dev-requirements.txt
@@ -0,0 +1 @@
+py-spy \ No newline at end of file
diff --git a/docs/doc-requirements.txt b/doc-requirements.txt
index 856b3f4c..856b3f4c 100644
--- a/docs/doc-requirements.txt
+++ b/doc-requirements.txt