Comments (3)
Hello, this issue is discussed in the README.
from djdt-flamegraph.
Thanks. python ./manage.py runserver --nothreading --noreload
worked. Would be nice if it detected this and de-activated itself. It might even be able to be detected in settings.py
to avoid listing it in INSTALLED_APPS
.
Now I run into #9
from djdt-flamegraph.
I am able to get it to be a bit less problematic with the following; is that worth submitting as-is, maybe with a warning emitted on the console?
class Sampler(object):
def __init__(self, interval=0.001):
self.stack_counts = collections.defaultdict(int)
self.interval = interval
+ self.disabled = False
def _sample(self, signum, frame):
stack = []
@@ -87,8 +87,13 @@
return '\n'.join('%s %d' % (key, value) for key, value in sorted(self.stack_counts.items()))
def start(self):
- signal.signal(signal.SIGALRM, self._sample)
- signal.setitimer(signal.ITIMER_REAL, self.interval, self.interval)
+ try:
+ signal.signal(signal.SIGALRM, self._sample)
+ signal.setitimer(signal.ITIMER_REAL, self.interval, self.interval)
+ except ValueError:
+ self.disabled = True
def stop(self):
+ if self.disabled:
+ return
signal.setitimer(signal.ITIMER_REAL, 0, 0)
from djdt-flamegraph.
Related Issues (7)
- 500: INTERNAL SERVER ERROR HOT 2
- Signals + subprocesses may lead to livelock HOT 5
- Signal handling may be delayed, which leads to dropped samples HOT 6
- nicer error page for missing start parameters HOT 4
- AttributeError: 'NoneType' object has no attribute 'get' when this package is installed. HOT 6
- make example returns error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from djdt-flamegraph.