mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-17 22:21:38 +03:00
Add another connector to snap
This commit is contained in:
parent
6f7a09686c
commit
f603e8412c
7
Makefile
7
Makefile
@ -287,6 +287,13 @@ run-browser: ## Start Glances in browser mode (RPC)
|
||||
run-issue: ## Start Glances in issue mode
|
||||
./venv/bin/python -m glances -C ./conf/glances.conf --issue
|
||||
|
||||
run-multipass: ## Install and start Glances in a VM (only available on Ubuntu with multipass already installed)
|
||||
multipass launch -n glances-on-lts lts
|
||||
multipass exec glances-on-lts -- sudo snap install glances
|
||||
multipass exec glances-on-lts -- glances
|
||||
multipass stop glances-on-lts
|
||||
multipass delete glances-on-lts
|
||||
|
||||
show-version: ## Show Glances version number
|
||||
./venv/bin/python -m glances -C ./conf/glances.conf -V
|
||||
|
||||
|
@ -140,12 +140,14 @@ class GlancesStandalone:
|
||||
"""
|
||||
# Update stats
|
||||
# Start a counter used to compute the time needed
|
||||
counter = Counter()
|
||||
counter_update = Counter()
|
||||
self.stats.update()
|
||||
logger.debug(f'Stats updated duration: {counter.get()} seconds')
|
||||
logger.debug(f'Stats updated duration: {counter_update.get()} seconds')
|
||||
|
||||
# Patch for issue1326 to avoid < 0 refresh
|
||||
adapted_refresh = (self.refresh_time - counter.get()) if (self.refresh_time - counter.get()) > 0 else 0
|
||||
adapted_refresh = (
|
||||
(self.refresh_time - counter_update.get()) if (self.refresh_time - counter_update.get()) > 0 else 0
|
||||
)
|
||||
|
||||
# Display stats
|
||||
# and wait refresh_time - counter
|
||||
@ -179,7 +181,7 @@ class GlancesStandalone:
|
||||
def serve_forever(self):
|
||||
"""Wrapper to the serve_forever function."""
|
||||
if self.args.stop_after:
|
||||
self.serve_n(self.args.stop_after)
|
||||
self.serve_n(n=self.args.stop_after)
|
||||
else:
|
||||
while self.__serve_once():
|
||||
pass
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: glances
|
||||
version: '4.1.2+build01' # Put the current stable version+buildXX
|
||||
version: '4.1.2+build02' # Put the current stable version+buildXX
|
||||
|
||||
summary: Glances an Eye on your system. A top/htop alternative.
|
||||
description: |
|
||||
@ -17,7 +17,7 @@ apps:
|
||||
command: bin/glances
|
||||
plugs: # https://snapcraft.io/docs/supported-interfaces
|
||||
- network
|
||||
- system-observe
|
||||
- system-observe # This one should give read access to all the system
|
||||
- mount-observe
|
||||
- hardware-observe
|
||||
- log-observe
|
||||
@ -32,6 +32,7 @@ apps:
|
||||
- power-control
|
||||
- process-control
|
||||
- network-setup-observe
|
||||
- all-home
|
||||
environment:
|
||||
LANG: C.UTF-8
|
||||
LC_ALL: C.UTF-8
|
||||
|
Loading…
Reference in New Issue
Block a user