Skip to main content

Profiling for the xonsh shell based on hunter.

Project description

xunter is to profiling xonsh shell using hunter. Time tracking is on board.

If you like the idea click ⭐ on the repo and tweet.

Install

Install xunter into the environment where xonsh you want to trace resides.

pip install xunter

Usage

Xunter is working as drop-in replacement of xonsh with additional arguments:

xonsh  --no-rc -c "2+2"
xunter --no-rc -c "2+2" ++depth-lt 5
#      ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
#            xonsh         xunter

Examples:

xunter --no-rc -c "2+2" ++depth-lt 10
xunter --no-rc ++depth-lt 5 ++output /tmp/22.xunter
xunter --no-rc -c '2+2' ++filter 'Q(filename_has="main.py")'

xunter --no-rc -c 'echo 1' ++filter 'Q(filename_has="specs.py"),Q(function="run_subproc")'
# [...]/site-packages/xonsh/procs/specs.py:910:run_subproc 
#   <= xonsh/built_ins.py:206:subproc_captured_hiddenobject 
#   <= <string>:1:<module> <= xonsh/codecache.py:64:run_compiled_code 
#   <= xonsh/codecache.py:218:run_code_with_cache
#   <= xonsh/main.py:519:main_xonsh 
#   <= xonsh/main.py:470:main 
#   <= xunter/xunter:91:<module>
#   - time_sec=[0.1505]

# Don't forget about xonsh`s awesome macro call:
xunter --no-rc -c 'echo 1' ++filter! Q(filename_has="specs.py"),Q(function="run_subproc")

To set ++filter read about filters and take a look into the cookbook.

Convert log to table

xunter --no-rc -c "2+2" ++depth-lt 10 ++printer stack ++output /tmp/22.xunter
xunter2excel /tmp/22.xunter

Investigations

By putting import ipdb; ipdb.set_trace() in the any place of code you can investigate the environment interactively.

Known issues

If you see the unexpected exceptions try to install xonsh from the main branch first.

See also

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

xunter-0.1.3.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

xunter-0.1.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file xunter-0.1.3.tar.gz.

File metadata

  • Download URL: xunter-0.1.3.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for xunter-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ff4654366216de23d532a30317d088ff13534a275b1454d1c21a92d402ac2c7e
MD5 708b00fe9ef1e636c69e10d4e8e06f26
BLAKE2b-256 b83dac36b3c49d67fff82ab4b26c3ea76fee2966e8e7b42ad3bbdd4dc7acd078

See more details on using hashes here.

File details

Details for the file xunter-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: xunter-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for xunter-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ef0938066520abbe1ab94e9c4e94573fb3ad8aef24e10c8896cd6d5b9811765f
MD5 3a684b3c50ac44f32565039fe0ab691b
BLAKE2b-256 cfd3846c72a0714407ae11f432eb0b17363e0c5cdc864d86f1e2a47327523322

See more details on using hashes here.

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