bminixhofer / permon

A tool to monitor everything you want. Clean, simple, extensible and in one place.
https://bminixhofer.github.io/permon
MIT License
81 stars 8 forks source link

Test permon on MacOS #9

Open bminixhofer opened 5 years ago

bminixhofer commented 5 years ago

Permon already works well on Linux, so I do not expect many issues on MacOS. I would greatly appreciate if someone else could test it because I do not currently have access to a mac. The test procedure on MacOS would be:

  1. Install permon: pip install git+https://github.com/bminixhofer/permon 1.1 Try permon terminal, permon browser and permon native and manually ensure adding / removing stats works and all stats are properly displayed. 1.2 Try adding a simple custom stat as described in the user doc.
  2. Clone permon and set it up for development as described in the contributor guide. 2.1 Run the tests and see if all of them pass: pytest tests/. 2.2 Build the docs (./bin/build-docs.sh) and the browser frontend (./bin/build-browser.sh) and see if these work without errors.

Make sure to do all of this in a virtual environment so that dependencies are not already installed.

NickFitton commented 5 years ago

Hey! I've been browsing GitHub help wanted and found this issue. If you'd like I can run your test procedure on my Mac tonight (I'm on GMT).

bminixhofer commented 5 years ago

Thanks! That would be great. I just added one more step to the procedure and fixed a link. Its good to go now.

NickFitton commented 5 years ago

Apologies for the delay permon terminal worked fine after it installing blessings There were a few weird points such as the error at the bottom of the view:

    7300 ┤                                                                              │                   
CPU Usage [%]                                                                         ╭ ├                   
   400.0 ┤                                                                              │                   
   371.4 ┤                                                                              │                   
   342.9 ┤                                                                              │                   
   314.3 ┤                                                                              │                   
   285.7 ┤  ╭╮                                                                          │                   
   257.1 ┤  ││ ╭╮                                                                       │                   
   228.6 ┤  ││ ││                                                      ╭╮ ╭╮            │                   
   200.0 ┤  ││ ││                                                      │╰─╯╰╮           │                   
   171.4 ┤ ╭╯│ ││                    ╭╮  ╭╮         ╭╮               ╭─╯    │╭╮ ╭╮      │                   
   142.9 ┤ │ │ ││              ╭─────╯╰╮ ││    ╭╮  ╭╯╰─╮   ╭╮ ╭╮     │      ╰╯╰╮││      │                   
   114.3 ┤─╯ ╰╮││ ╭╮  ╭╮  ╭╮╭╮╭╯       │╭╯╰╮╭╮╭╯╰──╯   ╰───╯╰─╯╰╮  ╭─╯         ╰╯╰╮     │                   
    85.7 ┤    ││╰╮│╰─╮││╭─╯╰╯││        ││  ╰╯╰╯                 ╰──╯              ╰╮    │                   
    57.1 ┤    ╰╯ ╰╯  ╰╯╰╯    ╰╯        ╰╯                                          ╰─── ├                   
    28.6 ┤                                                                              │ other             
     0.0 ┤                                                                              │                   
RAM Usage [MB]                                                                          │                   
   17100 ┤                                                                              │                   
   15900 ┤                                                                              │                   
   14700 ┤                                                                              │                   
   13400 ┤                                                                              │                   
   12200 ┤                                                                              │                   
   11000 ┤                                                                              │                   
    9800 ┤                                                                              │                   
    8500 ┤                                                                              │                   
    7300 ┤                                                                              │                   
    6100 ┤───────────────────────────────────────────────────────────────────────────── ├                   
    4900 ┤                                                                              │                   
    3600 ┤                                                                              │                   
    2400 ┤                                                                              │ other             
    1200 ┤                                                                              │                   
       0 ┤                                                                              │                   
Disk Read Speed [MB / s]                                                                │                   
   0.033 ┤                                      ╭────────╮                              │                   
   0.030 ┤                                      │        │                              │                   
   0.028 ┤                                      │        │                              │                   
   0.026 ┤                                      │        │                              │                   
   0.023 ┤                                      │        │                              │                   
   0.021 ┤                                      │        │                              │                   
   0.019 ┤                                      │        │                              │                   
   0.016 ┤                                      │        │                              │                   
   0.014 ┤                                      │        │                              │                   
   0.012 ┤                                      │        │                              │                   
   0.009 ┤     ╭────────╮                       │        │                              │                   
   0.007 ┤     │        │                       │        │                              │                   
   0.005 ┤     │        │                       │        │                              │                   
   0.002 ┤     │        │                       │        │                              │                   
   0.000 ┤─────╯        ╰───────────────────────╯        ╰───────────────────────────── │                   
Disk Write Speed [MB / s]] Operation not permitted
   0.324 ┤     ╭────────╮                                                               │                   
   0.300 ┤     │        │                                                               │                   
   0.277 ┤     │        │                                                               │                   
   0.254 ┤     │        │                                                               │                   
   0.231 ┤     │        │                                                               │                      0.208 ┤     │        │                                                               │                   
   0.185 ┤     │        │                                                               │                   
   0.162 ┤     │        │                                                               │                   
   0.139 ┤     │        │                                                               │                   
   0.116 ┤     │        │                                                               │                      0.092 ┤     │        │                                                               │                   
   0.069 ┤     │        │                                                               │                   
   0.046 ┤     │        │                                                               │                   
   0.023 ┤     │        │             ╭────────╮                                        │                   
   0.000 ┤─────╯        ╰─────────────╯        ╰─────────────────────────────────────── │                   
    raise AccessDenied(self.pid, self._name)
psutil._exceptions.AccessDenied: psutil.AccessDenied (pid=0, name='kernel_task')

Re-running in a smaller terminal shows this error at the top of the terminal display:

Traceback (most recent call last):
CPU Usage [%]ate/tmp/permon/lib/python3.6/site-packages/psutil/_psosx.py", line 342, in wrapper

Screenshot of the terminal

Running permon browser: Prompted to install:

So permon browser would not run.

permon native requested to install PySide2 Upon installation threw the following in the terminal:

08-12-2018 06:47:15 pm   Added stat core.cpu_usage
08-12-2018 06:47:15 pm   Added stat core.ram_usage
08-12-2018 06:47:15 pm   Added stat core.read_speed
08-12-2018 06:47:15 pm   Added stat core.write_speed
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/private/tmp/permon/lib/python3.6/site-packages/psutil/_psosx.py", line 342, in wrapper
    return fun(self, *args, **kwargs)
  File "/private/tmp/permon/lib/python3.6/site-packages/psutil/_psosx.py", line 486, in cpu_times
    rawtuple = self._get_pidtaskinfo()
  File "/private/tmp/permon/lib/python3.6/site-packages/psutil/_common.py", line 340, in wrapper
    return fun(self)
  File "/private/tmp/permon/lib/python3.6/site-packages/psutil/_psosx.py", line 401, in _get_pidtaskinfo
    ret = cext.proc_pidtaskinfo_oneshot(self.pid)
PermissionError: [Errno 1] Operation not permitted

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/private/tmp/permon/lib/python3.6/site-packages/permon/backend/stats/core.py", line 329, in _read_processes
    'cpu': proc.cpu_percent(),
  File "/private/tmp/permon/lib/python3.6/site-packages/psutil/__init__.py", line 987, in cpu_percent
    pt2 = self._proc.cpu_times()
  File "/private/tmp/permon/lib/python3.6/site-packages/psutil/_psosx.py", line 347, in wrapper
    raise AccessDenied(self.pid, self._name)
psutil._exceptions.AccessDenied: psutil.AccessDenied (pid=0, name='kernel_task')

Trying to add CPU temperature threw:

Traceback (most recent call last):
  File "/private/tmp/permon/lib/python3.6/site-packages/permon/frontend/native/utils.py", line 90, in addStat
    stat.check_availability()
  File "/private/tmp/permon/lib/python3.6/site-packages/permon/backend/stats/core.py", line 248, in check_availability
    if 'coretemp' not in psutil.sensors_temperatures():
AttributeError: module 'psutil' has no attribute 'sensors_temperatures'
file:///private/tmp/permon/lib/python3.6/site-packages/permon/frontend/native/qml/SettingsDrawer.qml:141: Error: module 'psutil' has no attribute 'sensors_temperatures'

Trying to add vRAM usage printed in the GUI: Error: /bin/sh: nvidia-smi: command not found Removing RAM from the display caused the app to freeze. Restarting worked and the RAM was no longer visible but nothing was logged about the freeze.

Removing all graphs showed:

Ignored NaN, Inf, or -Inf value.
file:///private/tmp/permon/lib/python3.6/site-packages/permon/frontend/native/qml/StatPage.qml:220: TypeError: Cannot call method 'forEach' of undefined

Running tests on the source throws:

(permonRepo) ➜  permon git:(dev) pytest tests
============================= test session starts ==============================
platform darwin -- Python 3.6.5, pytest-3.7.4, py-1.7.0, pluggy-0.8.0
rootdir: /private/tmp/permonRepo/permon, inifile:
plugins: mock-1.10.0, cov-2.5.1
collected 0 items / 1 errors                                                   

==================================== ERRORS ====================================
____________________ ERROR collecting tests/test_permon.py _____________________
tests/test_permon.py:18: in <module>
    stat.check_availability()
permon/backend/stats/core.py:248: in check_availability
    if 'coretemp' not in psutil.sensors_temperatures():
E   AttributeError: module 'psutil' has no attribute 'sensors_temperatures'
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.64 seconds ============================
NickFitton commented 5 years ago

If you'd like me to tweak or change anythong let me know

bminixhofer commented 5 years ago

Thanks a lot! To sum up, the issues are:

I managed to get an older version of MacOS running on my system, so I will be able to fix the errors myself. It would be great if you could verify it once they work on my machine though.

I'll track my progress here.

Edit: Errors shown in the GUI (such as the one that you saw when trying to add vRAM usage) are intended and just gracefully show that the respective stat is not available.

bminixhofer commented 5 years ago

The problems should be fixed now. permon browser might not work in Safari though. But that is another issue (#16). Can you verify that things are working now @NickFitton ?