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 details)

Uploaded Source

File details

Details for the file simpleprofiler-0.1.1.tar.gz.

File metadata

  • Download URL: simpleprofiler-0.1.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for simpleprofiler-0.1.1.tar.gz
Algorithm Hash digest
SHA256 81a5888c0a7d5db34bd6f98965761ede4fed75c10c4628ca764d2feb68cab90f
MD5 431005dca671e06555d141fde15d7875
BLAKE2b-256 89637458914079ddba066f8a5be29d2eca390fb5346abecb6a1f8bd5e1c73ca9

See more details on using hashes here.

Supported by

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