Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev middleware TimeMonitoring does not work on Macs #4459

Open
joemull opened this issue Oct 18, 2024 · 0 comments
Open

Dev middleware TimeMonitoring does not work on Macs #4459

joemull opened this issue Oct 18, 2024 · 0 comments
Labels
bug Something's not working

Comments

@joemull
Copy link
Member

joemull commented Oct 18, 2024

Problem

The TimeMonitoring middleware does not work on Darwin / Mac OSX due to an unavailable attribute resource.RUSAGE_THREAD.

@staticmethod
def _get_usage():
utime, stime, *_ = resource.getrusage(resource.RUSAGE_THREAD)
return (time.time(), utime, stime)

Proposed solution

Add a try / except to catch the attribute error, and try to fetch the appropriate Darwin resource. If that does not work, exit the middleware gracefully but allow Janeway to run.

@joemull joemull added the bug Something's not working label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's not working
Projects
None yet
Development

No branches or pull requests

1 participant