stackimpact / stackimpact-python
- среда, 28 июня 2017 г. в 03:12:21
StackImpact Python Agent - Production Profiler: CPU, memory allocations, exceptions, metrics, and more
StackImpact is a performance profiler for production applications. It gives developers continuous and historical view of application performance with line-of-code precision, which includes CPU, memory allocation and blocking call hot spots as well as execution bottlenecks, errors and runtime metrics. Learn more at stackimpact.com.
Learn more on the features page (with screenshots).
See full documentation for reference.
Sign up for a free account at stackimpact.com.
Install the Python agent by running
pip install stackimpact
And import the package in your application
import stackimpact
Start the agent in the main thread by specifying the agent key and application name. The agent key can be found in your account's Configuration section.
agent = stackimpact.start(
agent_key = 'agent key here',
app_name = 'MyPythonApp')
Add the agent initialization to the worker code, e.g. wsgi.py, if applicable.
Other initialization options:
app_version
(Optional) Sets application version, which can be used to associate profiling information with the source code release.app_environment
(Optional) Used to differentiate applications in different environments.host_name
(Optional) By default, host name will be the OS hostname.debug
(Optional) Enables debug logging.Once your application is restarted, you can start observing continuous CPU, memory, I/O, and other hot spot profiles, execution bottlenecks as well as process metrics in the Dashboard.
To enable debug logging, add debug = True
to startup options. If the debug log doesn't give you any hints on how to fix a problem, please report it to our support team in your account's Support section.
The agent overhead is measured to be less than 1% for applications under high load.