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
I'm not able to consistently reproduce this behavior but the problem obviously seems that the cpu_total read from the stats file is zero. It may be due to the newly launched docker container that has just started up.
One way to reproduce this (although in my local tests it rarely happens):
Launch a new python:3.7 container
Run any django manage.py command as CMD via Dockerfile
Expected behavior:
No ZeroDivisionError exception is thrown
Environment (please complete the following information)
OS: Linux
Python version: 3.7.4 (happens on 3.7.3 as well)
Framework and version [e.g. Django 2.1]: Django 2.2.6
APM Server version: v7.4.0
Agent version: 5.2.1
Additional context
I managed to fix this by catching this exception and setting the ration to 0 which I think makes sense.
Similar problem happens with cpu_process_percent which I solved the same way.
I can open up a pull request (with a corresponding test case in cpu_linux_test.py?) if that makes it easier.
Thanks,
Ivan
The text was updated successfully, but these errors were encountered:
Describe the bug:
When deploying my Django app on AWS Beanstalk the APM agent throws
ZeroDivisionError
with the trace:To Reproduce
I'm not able to consistently reproduce this behavior but the problem obviously seems that the
cpu_total
read from the stats file is zero. It may be due to the newly launched docker container that has just started up.One way to reproduce this (although in my local tests it rarely happens):
python:3.7
containermanage.py
command asCMD
via DockerfileExpected behavior:
No
ZeroDivisionError
exception is thrownEnvironment (please complete the following information)
Additional context
I managed to fix this by catching this exception and setting the ration to 0 which I think makes sense.
Similar problem happens with
cpu_process_percent
which I solved the same way.I can open up a pull request (with a corresponding test case in
cpu_linux_test.py
?) if that makes it easier.Thanks,
Ivan
The text was updated successfully, but these errors were encountered: