summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build.yml14
-rw-r--r--.github/workflows/cyber.yml2
-rw-r--r--.github/workflows/quality.yml6
-rw-r--r--.github/workflows/test.yml90
-rw-r--r--.github/workflows/webui.yml2
-rw-r--r--Makefile61
-rw-r--r--NEWS.rst1
-rw-r--r--README.rst54
-rw-r--r--conf/glances.conf37
-rw-r--r--dev-requirements.txt1
-rw-r--r--doc-requirements.txt1
-rwxr-xr-xdocker-compose/glances.conf47
-rw-r--r--docker-files/alpine.Dockerfile12
-rw-r--r--docker-files/ubuntu.Dockerfile24
-rw-r--r--docs/Makefile2
-rw-r--r--docs/_static/glances-cgraph.svg1389
-rw-r--r--docs/_static/glances-pyinstrument.html22
-rw-r--r--docs/aoa/containers.rst2
-rw-r--r--docs/aoa/cpu.rst13
-rw-r--r--docs/aoa/wifi.rst4
-rw-r--r--docs/api.rst697
-rw-r--r--docs/man/glances.16
-rw-r--r--docs/quickstart.rst6
-rw-r--r--glances/__init__.py4
-rw-r--r--glances/amps/amp.py2
-rw-r--r--glances/exports/export.py18
-rw-r--r--glances/exports/glances_mongodb/__init__.py2
-rw-r--r--glances/folder_list.py2
-rw-r--r--glances/globals.py2
-rw-r--r--glances/main.py19
-rw-r--r--glances/outputs/glances_bars.py2
-rw-r--r--glances/outputs/glances_curses.py92
-rw-r--r--glances/outputs/glances_restful_api.py14
-rw-r--r--glances/outputs/glances_stdout.py46
-rw-r--r--glances/outputs/glances_stdout_apidoc.py2
-rw-r--r--glances/outputs/glances_stdout_issue.py2
-rw-r--r--glances/outputs/static/README.md4
-rw-r--r--glances/outputs/static/js/App.vue2
-rw-r--r--glances/outputs/static/js/components/plugin-alert.vue5
-rw-r--r--glances/outputs/static/js/components/plugin-containers.vue34
-rw-r--r--glances/outputs/static/js/components/plugin-fs.vue4
-rw-r--r--glances/outputs/static/js/components/plugin-ip.vue15
-rw-r--r--glances/outputs/static/js/components/plugin-now.vue11
-rw-r--r--glances/outputs/static/js/components/plugin-percpu.vue91
-rw-r--r--glances/outputs/static/js/components/plugin-quicklook.vue28
-rw-r--r--glances/outputs/static/js/components/plugin-sensors.vue27
-rw-r--r--glances/outputs/static/js/components/plugin-wifi.vue10
-rw-r--r--glances/outputs/static/js/uiconfig.json2
-rw-r--r--glances/outputs/static/package-lock.json526
-rw-r--r--glances/outputs/static/public/glances.js2
-rw-r--r--glances/password.py2
-rw-r--r--glances/plugins/alert/__init__.py12
-rw-r--r--glances/plugins/amps/__init__.py2
-rw-r--r--glances/plugins/connections/__init__.py4
-rw-r--r--glances/plugins/containers/__init__.py69
-rw-r--r--glances/plugins/containers/engines/docker.py21
-rw-r--r--glances/plugins/containers/engines/podman.py4
-rw-r--r--glances/plugins/diskio/__init__.py3
-rw-r--r--glances/plugins/fs/__init__.py2
-rw-r--r--glances/plugins/help/__init__.py50
-rw-r--r--glances/plugins/ip/__init__.py18
-rw-r--r--glances/plugins/mem/__init__.py8
-rw-r--r--glances/plugins/now/__init__.py54
-rw-r--r--glances/plugins/percpu/__init__.py51
-rw-r--r--glances/plugins/plugin/model.py24
-rw-r--r--glances/plugins/plugin/view.py443
-rw-r--r--glances/plugins/processcount/__init__.py1
-rw-r--r--glances/plugins/processlist/__init__.py4
-rw-r--r--glances/plugins/quicklook/__init__.py120
-rw-r--r--glances/plugins/sensors/__init__.py151
-rw-r--r--glances/plugins/smart/__init__.py2
-rw-r--r--glances/plugins/system/__init__.py2
-rw-r--r--glances/plugins/version/__init__.py2
-rw-r--r--glances/plugins/wifi/__init__.py136
-rw-r--r--glances/processes.py128
-rw-r--r--glances/programs.py2
-rw-r--r--glances/snmp.py7
-rw-r--r--glances/standalone.py7
-rw-r--r--glances/stats.py39
-rw-r--r--glances/webserver.py2
-rw-r--r--optional-requirements.txt2
-rw-r--r--requirements.txt1
-rw-r--r--snap/snapcraft.yaml9
83 files changed, 3200 insertions, 1643 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 541c2336..88385df1 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -8,10 +8,12 @@ env:
DEFAULT_DOCKER_IMAGE: nicolargo/glances
NODE_ENV: ${{ (contains('refs/heads/master', github.ref) || startsWith(github.ref, 'refs/tags/v')) && 'prod' || 'dev' }}
PUSH_BRANCH: ${{ 'refs/heads/develop' == github.ref || 'refs/heads/master' == github.ref || startsWith(github.ref, 'refs/tags/v') }}
- # Alpine image do not support linux/arm/v6 and linux/arm/v6 - See issue #2735
- DOCKER_PLATFORMS: linux/amd64,linux/arm64,linux/386
- # Ubuntu image only support linux/amd64 and linux/arm64 - See issue #2185
- DOCKER_PLATFORMS_UBUNTU: linux/amd64,linux/arm64
+ # Alpine image platform: https://hub.docker.com/_/alpine
+ # linux/arm/v6,linux/arm/v7 do not work (timeout during the build)
+ DOCKER_PLATFORMS: linux/amd64,linux/arm64/v8
+ # Ubuntu image platforms list: https://hub.docker.com/_/ubuntu
+ # linux/arm/v7 do not work (Cargo/Rust not available)
+ DOCKER_PLATFORMS_UBUNTU: linux/amd64,linux/arm64/v8
on:
workflow_call:
@@ -104,7 +106,7 @@ jobs:
TAG_ARRAY="${TAG_ARRAY::-1} ]"
echo "Tags to build: $TAG_ARRAY"
- echo "::set-output name=tags::$TAG_ARRAY"
+ echo "tags=$TAG_ARRAY" >> $GITHUB_OUTPUT
build_Docker_image:
runs-on: ubuntu-latest
@@ -128,7 +130,7 @@ jobs:
org.opencontainers.image.url=https://nicolargo.github.io/glances/
- name: Cache Docker layers
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ env.NODE_ENV }}-${{ matrix.os }}-${{ matrix.tag.tag }}
diff --git a/.github/workflows/cyber.yml b/.github/workflows/cyber.yml
index 27a2c9b7..16752ca4 100644
--- a/.github/workflows/cyber.yml
+++ b/.github/workflows/cyber.yml
@@ -23,6 +23,6 @@ jobs:
severity: 'CRITICAL'
- name: Upload Trivy scan results to GitHub Security tab
- uses: github/codeql-action/upload-sarif@v2
+ uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml
index 6d0df601..2d2ea63e 100644
--- a/.github/workflows/quality.yml
+++ b/.github/workflows/quality.yml
@@ -26,7 +26,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@v2
+ uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -37,7 +37,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
- uses: github/codeql-action/autobuild@v2
+ uses: github/codeql-action/autobuild@v3
# ℹī¸ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -51,4 +51,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v2
+ uses: github/codeql-action/analyze@v3
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 030730f8..b7836ca4 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -10,7 +10,7 @@ jobs:
test-linux:
# https://github.com/actions/runner-images?tab=readme-ov-file#available-images
- runs-on: ubuntu-latest
+ runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
@@ -20,9 +20,10 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
+ cache: 'pip'
- name: Install dependencies
run: |
@@ -47,55 +48,84 @@ jobs:
run: |
python ./unitest.py
- test-windows:
+ # Error appear with h11, not related to Glances
+ # Should be tested if correction is done
+ # Installed c:\hostedtoolcache\windows\python\3.9.13\x64\lib\site-packages\exceptiongroup-1.2.1-py3.9.egg
+ # error: h11 0.14.0 is installed but h11<0.13,>=0.11 is required by {'httpcore'}
+ # Error: Process completed with exit code 1.
+ # test-windows:
+
+ # # https://github.com/actions/runner-images?tab=readme-ov-file#available-images
+ # runs-on: windows-2022
+ # strategy:
+ # matrix:
+ # # Python version "3.12" introduce this issue:
+ # # https://github.com/nicolargo/glances/actions/runs/6439648370/job/17487567454
+ # python-version: ["3.8", "3.9", "3.10", "3.11"]
+ # steps:
+
+ # - uses: actions/checkout@v4
+
+ # - name: Set up Python ${{ matrix.python-version }}
+ # uses: actions/setup-python@v5
+ # with:
+ # python-version: ${{ matrix.python-version }}
+ # cache: 'pip'
+
+ # - name: Install dependencies
+ # run: |
+ # python -m pip install --upgrade pip
+ # if (Test-Path -PathType Leaf "requirements.txt") { python -m pip install -r requirements.txt }
+ # python setup.py install
+
+ # - name: Unitary tests
+ # run: |
+ # python ./unitest.py
+
+ test-macos:
# https://github.com/actions/runner-images?tab=readme-ov-file#available-images
- runs-on: windows-latest
+ runs-on: macos-14
strategy:
matrix:
- # Python version "3.12" introduce this issue:
- # https://github.com/nicolargo/glances/actions/runs/6439648370/job/17487567454
- python-version: ["3.8", "3.9", "3.10", "3.11"]
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
+
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
+ cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- if (Test-Path -PathType Leaf "requirements.txt") { python -m pip install -r requirements.txt }
- python setup.py install
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Unitary tests
run: |
python ./unitest.py
- test-macos:
-
- # https://github.com/actions/runner-images?tab=readme-ov-file#available-images
- runs-on: macos-latest
- strategy:
- matrix:
- python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
-
- steps:
+ # Error when trying to implement #2749
+ # pkg: No packages available to install matching 'py-pip' have been found in the repositories
+ # test-freebsd:
- - uses: actions/checkout@v4
+ # runs-on: ubuntu-22.04
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v4
- with:
- python-version: ${{ matrix.python-version }}
+ # steps:
- - name: Install dependencies
- run: |
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+ # - uses: actions/checkout@v4
- - name: Unitary tests
- run: |
- python ./unitest.py \ No newline at end of file
+ # - name: Run tests
+ # uses: vmactions/freebsd-vm@v1
+ # with:
+ # usesh: true
+ # prepare: |
+ # pkg install -y python3 py-pip
+ # run: |
+ # set -e -x
+ # python3 -m pip install --user -r requirements.txt
+ # python ./unitest.py
diff --git a/.github/workflows/webui.yml b/.github/workflows/webui.yml
index 077b0b81..bc75b108 100644
--- a/.github/workflows/webui.yml
+++ b/.github/workflows/webui.yml
@@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Glances will be build with Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
diff --git a/Makefile b/Makefile
index b5aa1388..c61a300d 100644
--- a/Makefile
+++ b/Makefile
@@ -104,10 +104,25 @@ codespell: ## Run codespell to fix common misspellings in text files
semgrep: ## Run semgrep to find bugs and enforce code standards
./venv-dev/bin/semgrep scan --config=auto
-profiling: ## How to start the profiling of the Glances software
- @echo "Start a Glances instance and get its PID"
- @echo "Run: sudo ./venv-dev/bin/py-spy record -o ./docs/_static/glances-flame.svg -d 60 -s --pid <GLANCES PID>"
- @echo "Open the SVG file (./docs/_static/glances-flame.svg) with a Web browser"
+profiling-gprof: ## Callgraph profiling (need "apt install graphviz")
+ @echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)"
+ sleep 3
+ ./venv/bin/python -m cProfile -o ./glances.cprof ./run.py --stop-after 30
+ ./venv-dev/bin/gprof2dot -f pstats ./glances.cprof | dot -Tsvg -o ./docs/_static/glances-cgraph.svg
+ rm -f ./glances.cprof
+
+profiling-pyinstrument: ## PyInstrument profiling
+ @echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)"
+ sleep 3
+ ./venv/bin/pip install pyinstrument
+ ./venv/bin/python -m pyinstrument -r html -o ./docs/_static/glances-pyinstrument.html -m glances --stop-after 30
+
+profiling-pyspy: ## Flame profiling (currently not compatible with Python 3.12)
+ @echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)"
+ sleep 3
+ ./venv-dev/bin/py-spy record -o ./docs/_static/glances-flame.svg -d 60 -s -- ./venv/bin/python ./run.py --stop-after 30
+
+profiling: profiling-gprof profiling-pyinstrument profiling-pyspy ## Profiling of the Glances software
trace-malloc: ## Trace the malloc() calls
@echo "Malloc test is running, please wait ~30 secondes..."
@@ -184,19 +199,32 @@ snapcraft:
# ===================================================================
# Docker
+# Need Docker Buildx package (apt install docker-buildx on Ubuntu)
# ===================================================================
docker: docker-alpine docker-ubuntu ## Generate local docker images
-docker-alpine: ## Generate local docker images (Alpine)
- docker build --target full -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-full .
- docker build --target minimal -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-minimal .
- docker build --target dev -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-dev .
+docker-alpine: docker-alpine-full docker-alpine-minimal docker-alpine-dev ## Generate local docker images (Alpine)
-docker-ubuntu: ## Generate local docker images (Ubuntu)
- docker build --target full -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-full .
- docker build --target minimal -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-minimal .
- docker build --target dev -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-dev .
+docker-alpine-full: ## Generate local docker image (Alpine full)
+ docker buildx build --target full -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-full .
+
+docker-alpine-minimal: ## Generate local docker image (Alpine minimal)
+ docker buildx build --target minimal -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-minimal .
+
+docker-alpine-dev: ## Generate local docker image (Alpine dev)
+ docker buildx build --target dev -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-dev .
+
+docker-ubuntu: docker-ubuntu-full docker-ubuntu-minimal docker-ubuntu-dev ## Generate local docker images (Ubuntu)
+
+docker-ubuntu-full: ## Generate local docker image (Ubuntu full)
+ docker buildx build --target full -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-full .
+
+docker-ubuntu-minimal: ## Generate local docker image (Ubuntu minimal)
+ docker buildx build --target minimal -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-minimal .
+
+docker-ubuntu-dev: ## Generate local docker image (Ubuntu dev)
+ docker buildx build --target dev -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-dev .
# ===================================================================
# Run
@@ -211,6 +239,9 @@ run-debug: ## Start Glances in debug console mode (also called standalone)
run-local-conf: ## Start Glances in co