Stackdriver Profiler Python Agent
Project description
# Stackdriver Python profiling agent
Python profiling agent for
[Stackdriver Profiler](https://cloud.google.com/profiler/).
## Installation & usage
1. Install the profiler package using PyPI:
```shell
pip3 install google-cloud-profiler
```
2. Enable the profiler in your application:
```python
import googlecloudprofiler
def main():
# Profiler initialization. It starts a daemon thread which continuously
# collects and uploads profiles. Best done as early as possible.
try:
googlecloudprofiler.start(
service='hello-profiler',
service_version='1.0.1',
# verbose is the logging level. 0-error, 1-warning, 2-info,
# 3-debug. It defaults to 0 (error) if not set.
verbose=3,
# project_id must be set if not running on GCP.
# project_id='my-project-id',
)
except (ValueError, NotImplementedError) as exc:
print(exc) # Handle errors here
```
See
[Stackdriver Profiler profiling Python code](https://cloud.google.com/profiler/docs/profiling-python)
for detailed documentation.
Python profiling agent for
[Stackdriver Profiler](https://cloud.google.com/profiler/).
## Installation & usage
1. Install the profiler package using PyPI:
```shell
pip3 install google-cloud-profiler
```
2. Enable the profiler in your application:
```python
import googlecloudprofiler
def main():
# Profiler initialization. It starts a daemon thread which continuously
# collects and uploads profiles. Best done as early as possible.
try:
googlecloudprofiler.start(
service='hello-profiler',
service_version='1.0.1',
# verbose is the logging level. 0-error, 1-warning, 2-info,
# 3-debug. It defaults to 0 (error) if not set.
verbose=3,
# project_id must be set if not running on GCP.
# project_id='my-project-id',
)
except (ValueError, NotImplementedError) as exc:
print(exc) # Handle errors here
```
See
[Stackdriver Profiler profiling Python code](https://cloud.google.com/profiler/docs/profiling-python)
for detailed documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for google-cloud-profiler-1.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5db6e215aaf89a38a2130a9fb09b3a8b86c0ac5aff1657fbcae35db0fad50d25 |
|
MD5 | dcb76a89796eeef74ed161cb4ffb5672 |
|
BLAKE2b-256 | bd87bc6cde1621ec29fa8c7f45db480ab36f8a3abb39a80b8dc03bd438d9250f |