All Projects → alexmojaki → Heartrate

alexmojaki / Heartrate

Licence: mit
Simple real time visualisation of the execution of a Python program.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Heartrate

Moonsharp
An interpreter for the Lua language, written entirely in C# for the .NET, Mono, Xamarin and Unity3D platforms, including handy remote debugger facilities.
Stars: ✭ 926 (-19.34%)
Mutual labels:  debugger
Vim Padre
Debugger plugin for VIM
Stars: ✭ 42 (-96.34%)
Mutual labels:  debugger
Ios Sdk
AppSpector is a debugging service for mobile apps
Stars: ✭ 56 (-95.12%)
Mutual labels:  debugger
Picotrace
picotrace - system call process tracer
Stars: ✭ 26 (-97.74%)
Mutual labels:  debugger
Ansible Role Php Xdebug
Ansible Role - PHP Xdebug
Stars: ✭ 34 (-97.04%)
Mutual labels:  debugger
Pytest Pudb
Pytest PuDB debugger integration
Stars: ✭ 45 (-96.08%)
Mutual labels:  debugger
Ret Sync
ret-sync is a set of plugins that helps to synchronize a debugging session (WinDbg/GDB/LLDB/OllyDbg2/x64dbg) with IDA/Ghidra/Binary Ninja disassemblers.
Stars: ✭ 896 (-21.95%)
Mutual labels:  debugger
Simavr
simavr is a lean, mean and hackable AVR simulator for linux & OSX
Stars: ✭ 1,135 (-1.13%)
Mutual labels:  debugger
Hashlink Debugger
Visual Studio Code Debugger for Haxe/HashLink applications
Stars: ✭ 35 (-96.95%)
Mutual labels:  debugger
Indium
A JavaScript development environment for Emacs
Stars: ✭ 1,058 (-7.84%)
Mutual labels:  debugger
Vscode Lldb
A native debugger extension for VSCode based on LLDB
Stars: ✭ 866 (-24.56%)
Mutual labels:  debugger
Mu
A small, simple editor for beginner Python programmers. Written in Python and Qt5.
Stars: ✭ 960 (-16.38%)
Mutual labels:  debugger
Angrdbg
Abstract library to generate angr states from a debugger state
Stars: ✭ 49 (-95.73%)
Mutual labels:  debugger
Gdlv
GUI frontend for Delve
Stars: ✭ 935 (-18.55%)
Mutual labels:  debugger
Il Visualizer
.NET debugging visualiser for runtime-generated IL code (via DynamicMethod, etc) for VS2017 and VS2015
Stars: ✭ 56 (-95.12%)
Mutual labels:  debugger
Hxcpp Debugger
Visual Studio Code Debugger for Haxe/HXCPP applications
Stars: ✭ 18 (-98.43%)
Mutual labels:  debugger
Javafx Webview Debugger
Full Featured Google Chrome Dev Tools to JavaFX WebView browser debugging.
Stars: ✭ 45 (-96.08%)
Mutual labels:  debugger
React Native Debugger
The standalone app based on official debugger of React Native, and includes React Inspector / Redux DevTools
Stars: ✭ 9,052 (+688.5%)
Mutual labels:  debugger
Basicpawn
BasicPawn - SourcePawn Editor
Stars: ✭ 60 (-94.77%)
Mutual labels:  debugger
Gdbgui
Browser-based frontend to gdb (gnu debugger). Add breakpoints, view the stack, visualize data structures, and more in C, C++, Go, Rust, and Fortran. Run gdbgui from the terminal and a new tab will open in your browser.
Stars: ✭ 8,339 (+626.39%)
Mutual labels:  debugger

heartrate

This library offers a simple real time visualisation of the execution of a Python program:

demo

The numbers on the left are how many times each line has been hit. The bars show the lines that have been hit recently - longer bars mean more hits, lighter colours mean more recent.

Calls that are currently being executed are highlighted thanks to the executing library.

It also shows a live stacktrace:

stacktrace

Installation

pip install --user heartrate

Supports Python 3.5+.

Usage

import heartrate; heartrate.trace(browser=True)

This will:

  • Start tracing your program
  • Start a server in a thread
  • Open a browser window displaying the visualisation of the file where trace() was called.

In the file view, the stacktrace is at the bottom. In the stacktrace, you can click on stack entries for files that are being traced to open the visualisation for that file at that line.

trace only traces the thread where it is called. To trace multiple threads, you must call it in each thread, with a different port each time.

Options

  • files determines which files get traced in addition to the one where trace was called. It must be a callable which accepts one argument: the path to a file, and returns True if the file should be traced. For convenience, a few functions are supplied for use, e.g.:

    from heartrate import trace, files
    trace(files=files.path_contains('my_app', 'my_library'))
    

    The supplied functions are:

    • files.all: trace all files.
    • files.path_contains(*substrings) trace all files where the path contains any of the given substrings.
    • files.contains_regex(pattern) trace all files which contain the given regex in the file itself, so you can mark files to be traced in the source code, e.g. with a comment.

    The default is to trace files containing the comment "# heartrate" (spaces optional).

    If you're tracing multiple files, there are two ways to get to the pages with their visualisations:

    1. In the stacktrace, click on stack entries for files that are being traced. This will open the page and jump to the line in that stack entry.
    2. Go to the index page at http://localhost:9999/ (you can click on the logo in the top left corner) to see a list of traced files.
  • host: HTTP host for the server. To run a remote server accessible from anywhere, use '0.0.0.0'. Default '127.0.0.1'.

  • port: HTTP port for the server. Default 9999.

  • browser: if True, automatically opens a browser tab displaying the visualisation for the file where trace is called. False by default.

  • daemon: sets whether the thread containing the server is a daemon thread. Set this to true to shut down the server once the rest of the program completes.

Related libraries

  • pyheat: a heatmap showing which lines of a file consume the most time.
  • snoop: a feature-rich and convenient debugging library which records every line executed, the local variables at each point, and other information.
  • birdseye: a debugger which lets you easily view the value the value of every expression
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].