Skip to main content

No project description provided

Project description

simpleprofiler

Tool to profile your code in python

Installation

pip install simpleprofiler

Logging Level

Defaultly simpleprofiler use INFO as logging level

Example

Code:

from simpleprofiler import get_profile

import logging
logging.basicConfig()
logging.getLogger().setLevel(logging.INFO)
_logger = logging.getLogger(__name__)

@get_profile
def try_func(bool, arr):
    if bool:
        for item in arr:
            _logger.info(item)
    else:
        for item in arr:
            _logger.info(info)

try_func(True, ["try" * 10])

On Console:

try_func >  calls     ms
try_func >  ------------------------------------ /DIRECTORY_TO/example.py, 8

try_func > 1         0.0       @get_profile
try_func >                     def try_func(bool, arr):
try_func > 1         0.0           if bool:
try_func > 2         0.0               for item in arr:
try_func > 1         0.21                  _logger.info(item)
try_func >                         else:
try_func >                             for item in arr:
try_func >                                 _logger.info(item)

try_func > Total:
try_func > 1         0.21  

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simpleprofiler-0.1.1.tar.gz (3.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page