You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a few times within in a putty session, it shows different values:
If cpu_percent() is called from a apache/django/mvt python script, than it returns the correct value only once.
All further calls always return the same value.
I need to restart the Apache service to get new values.
The text was updated successfully, but these errors were encountered:
grasmax
changed the title
RaspberryCM4/Apache/Django/psutil596: Result of cpu_percent(..) is 0
RaspberryCM4/Apache/Django/psutil596: cpu_percent(..) returns the correct value only once
Nov 30, 2023
grasmax
changed the title
RaspberryCM4/Apache/Django/psutil596: cpu_percent(..) returns the correct value only once
RaspberryCM4/Apache/Django/psutil596: cpu_percent(..) returns the correct value only once, getloadavg() too
Dec 4, 2023
Problem: cpu_percent() and getloadavg() were called in a construktor of a model class and stored to a static member.
Solution: the result of cpu_percent() and getloadavg() are stored in a member variable of an instance of the model class.
Summary
Description
If I call a python script like
a few times within in a putty session, it shows different values:
If cpu_percent() is called from a apache/django/mvt python script, than it returns the correct value only once.
All further calls always return the same value.
I need to restart the Apache service to get new values.
The text was updated successfully, but these errors were encountered: