-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add allocation logging and visualization (#64)
* Basic Logging in binary format * write correct Segment size * minor * Fix None unwrap * First visualization of allocations * Storage saving binary logging * faster bitmap getting * minor * visualize bitmap by storage layer * Speed up plotting by precalculating things * New get with output parameter, initial timestep is 1 * Experimented with unpacked storage * Enforce max timestep * Remove simple plot * visual improvements * First export to mp4 * minor * Color disks seperately * Validation helpers * minor * Calculate and Plot fragmentation * Indicate Timestep, handle empty storage * Type hints, formatting * parallel fragmentation building * Code reorganization * parallel video exporting * Rewrite of visualization script with better performance, memory usage and organization * backend selection parameter for matplotlib * Handle missing input file correctly * Plot correct global fragmentation * runtime plot adjustments * remove dependency of slider for exporting * Plot failed allocations * CLI improvements * plot free blocks * use packed bits for faster plotting * plot allocation sizes * minor changes for visual clarity * minor * minor * unaligned allocation tries * lines to seperate segments * allocation_log feature flag * more complete allocation_log feature flag * runtime allocation_log path * information on how to visualize allocations * moved scripts to project root * removed allocation tries, instead count cycles Different allocators have different or even no notion of a try. So instead remove tries completely and introduce an allocator agnostic metric to measure how long an allocation takes. * proportion of cycles spent in allocator
- Loading branch information
Showing
8 changed files
with
1,518 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Allocation Log Visualization | ||
|
||
This script visualizes the allocation and deallocation of blocks within the key-value database. It helps to understand how storage space is being used and identify potential optimization opportunities. | ||
|
||
The allocation log visualization script is tested with Python 3.12.7 and the packages listed in `requirements.txt`. | ||
|
||
The main dependencies are matplotlib, tqdm and sortedcontainers. | ||
|
||
## Setup | ||
|
||
Run the following to create a working environment for the script: | ||
|
||
```bash | ||
python3 -m venv .venv | ||
source .venv/bin/activate | ||
python3 -m pip install -r scripts/requirements.txt | ||
``` | ||
|
||
## Generating the Allocation Log | ||
|
||
To generate the `allocation_log.bin` file, you need to enable the allocation_log feature flag when compiling the `betree` crate. For instance by running | ||
```bash | ||
cargo build --features allocation_log | ||
``` | ||
or by enabling it in the `Cargo.toml`. | ||
|
||
The path where the log is saved can be set with the runtime configuration parameter `allocation_log_file_path`. The default is `$PWD/allocation_log.bin` | ||
|
||
## Using the Allocation Log | ||
|
||
Once a log file has been obtained simply run the following to visualize the (de-)allocations recorded. | ||
```bash | ||
./scripts/visualize_allocation_log allocation_log.bin | ||
``` | ||
|
||
To get help and see the options available run the script with the `-h` flag. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
contourpy==1.3.1 | ||
cycler==0.12.1 | ||
fonttools==4.55.3 | ||
kiwisolver==1.4.7 | ||
matplotlib==3.9.3 | ||
numpy==2.2.0 | ||
packaging==24.2 | ||
pillow==11.0.0 | ||
pyparsing==3.2.0 | ||
python-dateutil==2.9.0.post0 | ||
six==1.17.0 | ||
sortedcontainers==2.4.0 | ||
tqdm==4.67.1 |
Oops, something went wrong.