Blackfire Python SDK
Project description
Blackfire SDK for Python
Blackfire Python SDK is a Python library that manages the Blackfire Python Profiler and handles communication with Blackfire.io servers.
Read the official Blackfire documentation for more information.
Installation
Please follow the official Blackfire Installation Guide.
Usage
These examples and more can be found on the official Blackfire Python SDK documentation
Manual profiling
Following is an example of manual profiling:
from blackfire import probe
probe.initialize(client_id='xxxxx', client_token='xxxxx')
probe.enable()
foo()
bar()
baz()
probe.end() # this will send all collected data Blackfire.io servers
You can view your profiles here: https://blackfire.io/my/profiles
Aggregation of Traces
We can call enable()
/disable()
multiple times until we finally call end()
.
from blackfire import probe
probe.initialize()
probe.enable()
foo()
probe.disable()
probe.enable()
bar()
probe.disable()
with probe.run():
baz()
Profiling Python scripts via CLI
Save below as foo.py
:
def foo():
print('foo called!')
foo()
Then run following:
blackfire run python foo.py
Above command will run your script till end and uploads the profile payload to https://blackfire.io/my/profiles
Profiling Django via Middleware
Read the Django Integration documentation on the Blackfire website.
-
Install the Blackfire Browser Extension.
-
Add Blackfire middleware in your Django
settings.py
as following:MIDDLEWARE = [ ... ... 'blackfire.middleware.DjangoMiddleware', ]
-
Follow these steps to profile via Browser.
Resources
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 Distributions
Built Distributions
Hashes for blackfire-1.3.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f1de501d7852d8be8c3b4322ff46d03422ac7b01e2b6abb4e848947f0bbe8dd |
|
MD5 | d12a3b3f5f80f8ce7788941c0fcda4a2 |
|
BLAKE2b-256 | d2500f488502f0e4eb60b92e541d4230063dc724a43ed7d69cd87dbbf36173a6 |
Hashes for blackfire-1.3.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e877d782346489e98edbc4db63425b219a9bd50aa67d78bb60153fdfc260136 |
|
MD5 | 78ed7b3bac69037349ff57d5d46a8505 |
|
BLAKE2b-256 | d84c5445e414fab56b413940f8fe3a9e208a0f82929856399d6d4b58b6d1bd19 |
Hashes for blackfire-1.3.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8eb9fb10542fc6845be72b5676d82d0a3bcfb8920d777ba69f400b8880c10e4 |
|
MD5 | 0eeb3acdc3e03204ebe8973886eef3e7 |
|
BLAKE2b-256 | 6502de739a20e9cf9fe05659ff0b1bffd5cc60965fe415ea62f92f850246bb45 |
Hashes for blackfire-1.3.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ddbe8ef4dc94094a435dc6889b27692f128cbb4f7c8aa37a99411931143e42b |
|
MD5 | d44454460984acf6824912bc3cddc62e |
|
BLAKE2b-256 | c7dbc0a1d9f12eb078b57d85b708a9d73bf98318bcea063b748ac999fadcd180 |
Hashes for blackfire-1.3.2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d38795e86d14c27a22c3319c5e639712d656a6da07e05b6c5e512b95e8362570 |
|
MD5 | 634c189b0e49922365b71b55c49842b4 |
|
BLAKE2b-256 | 3edf5dfc329878eb16b3e48c0ef4885f221cbe4d31d375fdae606728e77d8ab7 |
Hashes for blackfire-1.3.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9031c858d49040dec811709c552900f1bb1f0a04de18f8573d93b858d76e11e9 |
|
MD5 | 046e2122a2d803fc1b2b691f9afbd24d |
|
BLAKE2b-256 | 7e3f0f23c306950fd0e001b620b02e704c6b222d2790f6b3300c9460540d5bfe |
Hashes for blackfire-1.3.2-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad2f38e0851d2be75905a6ec6471dd5233e71e020f1cb0530342d2a264db68e6 |
|
MD5 | 75287b274a0728f49f2d7adfdc3aa6c3 |
|
BLAKE2b-256 | cefe41de668445c2678d16798b4865e5d1648f157b346c00028e720a021f17cc |
Hashes for blackfire-1.3.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d80b314a923b9e895caefab71e3a76908f51527fd7078da300623d4556f8e6b |
|
MD5 | 964f5097c1b25daf88e9d1879e4fe516 |
|
BLAKE2b-256 | 9b335d77ffaabd88cf286ea7843b7e60e05ab98419973f3cabbd9ef397d079f2 |
Hashes for blackfire-1.3.2-cp34-cp34m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 616a55318e725fbb282a6f386ce23318208ca5bf133aeee608ef21ba39356974 |
|
MD5 | 5868e5b3caca7eae6c21ddfd0762288e |
|
BLAKE2b-256 | ca6e1d3f33dbac80b8d377a05a2f0a0d15c509ceff3d8e05bf332728e0026525 |
Hashes for blackfire-1.3.2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b345966680f9dece98e8f37127c9009aa22b00e3994d15103e94df05df60933d |
|
MD5 | 4621ac3f003bb995e420d981f16bc35c |
|
BLAKE2b-256 | 0414416dc75b03344c02fc1fbcaebe596aab93d3123483da2f5a1110c4d4600f |
Hashes for blackfire-1.3.2-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c68a1d2b739cec6b6a26f4155cccf3fe8fbcf2597bc4fd2a057ca60e27d46e9 |
|
MD5 | f2e49f19afb8682ec01a40f4c6296a4b |
|
BLAKE2b-256 | ea47f8ed6835eea3ea1ce923cda7a26cd00e12c26349a1d5407c4d98c9b68af4 |
Hashes for blackfire-1.3.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05be1ac01be3f0b118081801412b4580248de18d9b03a96fc4ef0e8e6439b4e8 |
|
MD5 | dae93376bfb8981d90940251d4c910e1 |
|
BLAKE2b-256 | c09598e39ecb86632a6ffb7cc57469a52d693cde38f4ae40131b219221bc1777 |
Hashes for blackfire-1.3.2-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6707980bac3d419d708f393661101075f9e622e55bdc1582954bcce66ab2e785 |
|
MD5 | 54c8c302219473476424139d27fd06ea |
|
BLAKE2b-256 | 24e586ab92aa2c237fd2fb6eaa314ff053b5b0a71f3cb1c20eb685681a5546d0 |
Hashes for blackfire-1.3.2-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bf347a2f315cd63d5303f91dc8670e5c4ccb794218268ee65b98dd20ce736c7 |
|
MD5 | 0cb908035d5b56d155e7531cda839be6 |
|
BLAKE2b-256 | 7a938e750f446a0078cda14ff836a03520ea4016b5039023358bf0cf7c156988 |
Hashes for blackfire-1.3.2-cp27-cp27m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 013ead7be80f93b34b54f7d101450b46809a51441feb9254a226f6e6da15fb62 |
|
MD5 | 03c20d000843e34d3ec5145a06efb86a |
|
BLAKE2b-256 | f5111743973a20c50a1a1d6b53d8e43ebb6bcb1ceed47d432741f2f8d91aecf9 |
Hashes for blackfire-1.3.2-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b57d63e73ce76ac9e783c67a54ae5cbc0a5c2beca9b14e4515dc5a1357089716 |
|
MD5 | 8a4d4ded8665b206825e7d9262b00f8d |
|
BLAKE2b-256 | 618eed06a7d21529e708ef54d4fa15b2954997f14df8d711babc8814de9e1058 |
Hashes for blackfire-1.3.2-cp27-cp27m-macosx_10_11_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ff2f244a6d936785090936f44df9c1d6f5252256e304e91e1a07f66c0cf8def |
|
MD5 | d6a0f194c709bd47833fcde56e02819b |
|
BLAKE2b-256 | d98616b5f5c8fb0e13feed5bcff53e23162a6980d06d6e82df06c5eda15d9867 |