dbgbb
dbgbb is a robust framework for analyzing debugging data within Mathematica and Jupyter notebooks.
Related projects: ArrayObject, BulletinBoard.
Features
- Seamless integration with
BulletinBoardfor reading test data and sending debug data using concise macros. - Automatic inclusion of file name, line number, and column number in debug tags.
- Buffered sender option minimizes TCP transactions, preserving program performance.
- Comprehensive data collection tools: accumulation, one-shot, and frequency reduction.
- Real-time and persistent access to debug data during and after program execution.
- In-memory server storage enables ultra-fast random access to debugging data.
- Supports unsigned/signed integers, floating-point real and complex numbers, strings, and arrays (
Vec<_>,[T;N],ndarray,nalgebra). - High-speed communication via Unix sockets on compatible operating systems.
sequenceDiagram
Program->>BulletinBoard: Debugging data
BulletinBoard->>Program: Test data
Program->>BulletinBoard: Debugging data
Notebook->>BulletinBoard: Request
BulletinBoard->>Notebook: Response
Program->>BulletinBoard: Debugging data
Program->>BulletinBoard: Debugging data
Important Notes
- Data transmission is not encrypted. Do not send confidential information over the network.
- This crate is under development; APIs and specifications may change. Compatibility between
BulletinBoardanddbgbbis maintained for matching minor version numbers. - Running tests will access the server and may overwrite existing data.
Getting Started
Before using dbgbb, set up a BulletinBoard server and configure the server address via an environment variable. For Rust projects, one may add the following to .cargo/config.toml:
[]
= "ADDRESS:PORT"
Basic Usage
Send data to the server with minimal code:
use dbgbb;
For nested arrays (Vec<Vec<...>>), see dbgbb_flatten!(...), dbgbb_concat!(...), and dbgbb_index!(...).
Accumulating Data
Accumulate data before transmission. Arrays must have consistent shapes.
use dbgbb_acc;
Frequency Control and Buffering
Control data acquisition frequency with oneshot or every. Rename variables with .rename(...). To reduce TCP transactions, enable buffering:
use *;
Note: Use let _buf = ... to keep the buffer active. Using let _ = ... will immediately drop the buffer.
Reading Data
Retrieve data from the server:
use dbgbb_read;
Environment Variables
| Variable | Default | Description |
|---|---|---|
| BB_ADDR | "127.0.0.1:7578" or "/tmp/bb.sock" | Address of the BulletinBoard server. Use [IP address]:[port], [hostname]:[port], or a Unix socket path. |
| BB_INTERVAL | "1000" | Minimum interval (ms) for buffered sender to transmit data. |
| BB_TIMEOUT | "3000" | Timeout (ms) for buffered sender to wait for data (for infrequent cases). |
Crate Features
| Feature | Description |
|---|---|
unix |
Enables Unix socket support (Unix-like OS only). |
no_compression |
Disables compression for improved performance with random floating-point data. |
ndarray_15 |
Enables support for ndarray version 0.15.x. |
ndarray_16 |
Enables support for ndarray version 0.16.x. |
ndarray_17 |
Enables support for ndarray version 0.17.x. |
nalgebra_33 |
Enables support for nalgebra version 0.33.x. |
nalgebra_34 |
Enables support for nalgebra version 0.34.x. |
