Skip to content

CLI Reference: benchbox visualize

Generate ASCII charts directly from benchmark result JSON files.

Synopsis

benchbox visualize [SOURCES...] [OPTIONS]

Description

The visualize command transforms BenchBox result JSON files into ASCII charts rendered directly in the terminal. It supports multiple chart types, templates for common workflows, and display customization options.

Auto-detection: When no sources are specified, automatically finds the latest results in benchmark_runs/results/.

Arguments

SOURCES (optional) : One or more result JSON files or glob patterns. If omitted, uses the latest result files.

Terminal window
benchbox visualize
benchbox visualize results.json
benchbox visualize results/*.json
benchbox visualize run1.json run2.json

The four commands auto-detect the latest results, read a single file, expand a glob pattern, and read multiple files, in that order.

Options

Template Selection

--template {default,flagship,head_to_head,trends,cost_optimization,comparison,latency_deep_dive,regression_triage,executive_summary} : Use a predefined chart template. Overrides --chart-type.

Terminal window
benchbox visualize results/*.json --template flagship

Chart Type Selection

--chart-type {auto,all,performance_bar,power_bar,distribution_box,query_heatmap,query_histogram,cost_scatter,time_series,...} : Specify chart types to generate. Repeatable for multiple types. Run benchbox visualize --help for the full list.

Terminal window
benchbox visualize results/*.json --chart-type performance_bar --chart-type distribution_box
ValueDescription
autoRender all applicable chart types (default)
allSame as auto
performance_barPlatform comparison bar chart (total execution time, lower is better)
power_barTPC Power@Size comparison bar chart; falls back to power-run query latency bars when no TPC metric exists
distribution_boxLatency distribution box plot
query_heatmapQuery x platform variance heatmap
query_histogramPer-query latency bars; uses horizontal bars for long query labels and vertical bars otherwise
cost_scatterCost-performance scatter plot
time_seriesPerformance trend line chart
comparison_barPer-query paired bars with % change (requires 2 results)
diverging_barPercentage change centered on zero (requires 2 results)
summary_boxKey aggregate statistics panel
percentile_ladderP50/P90/P95/P99 ladder across platforms
normalized_speedupLog₂-scaled speedup relative to a baseline
stacked_phaseStacked phase breakdown by benchmark phase
sparkline_tableCompact metric table with sparklines
cdf_chartCumulative distribution of query latency
rank_tablePer-query platform rankings (1st = fastest)

Appearance

--theme {light,dark} : Color theme for charts.

Terminal window
benchbox visualize results/*.json --theme dark

Default: light

--no-color : Disable ANSI colors in output. Useful for piping to files or plain terminals.

Terminal window
benchbox visualize results/*.json --no-color > charts.txt

--no-unicode : Use ASCII-only characters instead of Unicode block characters. For terminals without Unicode support.

Terminal window
benchbox visualize results/*.json --no-unicode

Examples

Basic Usage

Terminal window
benchbox visualize
benchbox visualize benchmark_runs/results/tpch_duckdb_sf1.json
benchbox visualize duckdb.json snowflake.json bigquery.json

The commands generate charts from the latest result (auto-detected), from a specific file, and from multiple files for comparison.

Using Templates

Terminal window
benchbox visualize results/*.json --template flagship
benchbox visualize platform_a.json platform_b.json --template head_to_head
benchbox visualize runs/2024/*.json runs/2025/*.json --template trends
benchbox visualize cloud_results/*.json --template cost_optimization

The templates give a flagship comparison (a four-chart set), a head-to-head comparison, performance trends over time, and a cost optimization analysis, in that order.

Display Options

Terminal window
benchbox visualize results/*.json --theme dark
benchbox visualize results/*.json --chart-type performance_bar --chart-type cost_scatter
benchbox visualize results/*.json --no-color > comparison.txt
benchbox visualize results/*.json --no-unicode
benchbox visualize results/*.json --theme dark --no-color --no-unicode

The commands select the dark theme, limit output to specific chart types, produce pipe-friendly output with no ANSI codes, produce ASCII-only output for basic terminals, and combine options.

Query Latency Histogram

Terminal window
benchbox visualize results/*.json --chart-type query_histogram
benchbox visualize tpcds_results.json --chart-type query_histogram

The first command draws a per-query latency histogram, which is ideal for identifying slow queries. TPC-DS results are split automatically into three charts (99 queries, 33 per chart).

Output

Charts render directly to the terminal (stdout). All output is text-based with optional ANSI color codes.

To save output to a file:

Terminal window
benchbox visualize results/*.json > charts.ansi
benchbox visualize results/*.json --no-color > charts.txt

The first command preserves ANSI codes, so the file is viewable in terminals that support ANSI. The second writes plain text with no color codes.

Exit Codes

CodeMeaning
0Success
1Error (invalid input, no results found, etc.)

Dependencies

No additional dependencies required. Visualization is built into BenchBox core.

See Also