LinuxMonitor 1.4.0__tar.gz → 1.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: LinuxMonitor
3
- Version: 1.4.0
3
+ Version: 1.4.2
4
4
  Summary: Get information and warning status of Linux server like service, port, ping, ssl certificate, disk/folder/cpu/ram/swap usage, ip connection, ... (Python and shell library, Linux ONLY)
5
5
  Home-page: https://github.com/QuentinCG/Linux-Monitor-Python-Library
6
6
  Author: Quentin Comte-Gaz
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: LinuxMonitor
3
- Version: 1.4.0
3
+ Version: 1.4.2
4
4
  Summary: Get information and warning status of Linux server like service, port, ping, ssl certificate, disk/folder/cpu/ram/swap usage, ip connection, ... (Python and shell library, Linux ONLY)
5
5
  Home-page: https://github.com/QuentinCG/Linux-Monitor-Python-Library
6
6
  Author: Quentin Comte-Gaz
@@ -33,7 +33,7 @@ __email__ = "quentin@comte-gaz.com"
33
33
  __license__ = "MIT License"
34
34
  __copyright__ = "Copyright Quentin Comte-Gaz (2024)"
35
35
  __python_version__ = "3.+"
36
- __version__ = "1.4.0 (2024/10/07)"
36
+ __version__ = "1.4.2 (2024/10/07)"
37
37
  __status__ = "Usable for any Linux project"
38
38
 
39
39
  import json
@@ -1681,7 +1681,7 @@ class LinuxMonitor:
1681
1681
  :return: A string containing the result message.
1682
1682
  """
1683
1683
  try:
1684
- processes = []
1684
+ processes = []
1685
1685
 
1686
1686
  # To get meaningful results, we need to ask cpu percent and wait a bit to get valid cpu_percent values on second iteration
1687
1687
  for dummy_process in psutil.process_iter(['pid', 'name', 'username', 'cpu_percent', 'memory_info', 'create_time', 'cmdline']):
@@ -1690,7 +1690,7 @@ class LinuxMonitor:
1690
1690
  dummy_process.cpu_percent(interval=None)
1691
1691
  except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
1692
1692
  continue
1693
- await asyncio.sleep(delay=0.1)
1693
+ await asyncio.sleep(delay=1)
1694
1694
 
1695
1695
  # Then we can get the processes
1696
1696
  for process in psutil.process_iter(['pid', 'name', 'username', 'cpu_percent', 'memory_info', 'create_time', 'cmdline']):
@@ -1707,7 +1707,7 @@ class LinuxMonitor:
1707
1707
  'pid': process.info['pid'],
1708
1708
  'name': process.info['name'],
1709
1709
  'username': process.info['username'],
1710
- 'cpu_percent': process.info['cpu_percent'],
1710
+ 'cpu_percent': process.cpu_percent(interval=None),
1711
1711
  'memory': process.info['memory_info'].rss, # Resident Set Size (RSS) memory
1712
1712
  'create_time': create_time,
1713
1713
  'cmdline': cmdline
@@ -1723,7 +1723,7 @@ class LinuxMonitor:
1723
1723
  if not get_non_consuming_processes and proc['cpu_percent'] == 0 and proc['memory'] == 0:
1724
1724
  continue
1725
1725
 
1726
- res = f"- PID **{proc['pid']}**: {proc['name']} ("
1726
+ res: str = f"- PID **{proc['pid']}**: {proc['name']} ("
1727
1727
 
1728
1728
  if proc['cpu_percent'] > 0:
1729
1729
  res += f"CPU {proc['cpu_percent']}%, "
@@ -6,7 +6,7 @@ with io.open(file='README.md', mode='r', encoding='utf-8') as readme_file:
6
6
 
7
7
  setup(
8
8
  name="LinuxMonitor",
9
- version="1.4.0",
9
+ version="1.4.2",
10
10
  description="Get information and warning status of Linux server like service, port, ping, ssl certificate, disk/folder/cpu/ram/swap usage, ip connection, ... (Python and shell library, Linux ONLY)",
11
11
  long_description=readme,
12
12
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes