Skip to content

Add CSV and JSONL statistics output - #4

Open
m4r1k wants to merge 1 commit into
atoonk:mainfrom
m4r1k:pr/stats-export-v0.3.0
Open

Add CSV and JSONL statistics output#4
m4r1k wants to merge 1 commit into
atoonk:mainfrom
m4r1k:pr/stats-export-v0.3.0

Conversation

@m4r1k

@m4r1k m4r1k commented Aug 11, 2026

Copy link
Copy Markdown

Wireblast's terminal output is useful while a run is active, but benchmark
automation should not have to parse display text. This adds optional
machine-readable statistics to --no-tui.

--stats-file PATH creates a new output file and refuses to overwrite an
existing one. CSV is the default format; --stats-format jsonl selects
newline-delimited JSON. Each one-second sample is flushed immediately, so an
interrupted run still leaves usable records. Clean shutdown adds a final
aggregate and one record for every AF_XDP queue.

Every record has a schema version, UTC timestamp, elapsed time, traffic totals
and rates, and the Linux XDP_STATISTICS counters. The schema distinguishes
Wireblast packet totals from AF_XDP ring accounting:
kernel_rx_descriptors and kernel_tx_descriptors report descriptor progress,
not packet counts. A multi-buffer packet can occupy more than one descriptor.
The six AF_XDP counter fields use their Linux UAPI names.

The existing terminal output is unchanged. Statistics paths and formats belong
to one invocation and are not saved in wizard preferences. The patch adds no
dependencies.

The CSV path was also exercised between paired Google Cloud C4N instances from
c4n-highcpu-2 through c4n-highcpu-96. Every admitted run used gVNIC with the
GVE driver, native XDP, and AF_XDP zero-copy. The inline CSV sample is derived
from a C96 IMIX run; its records come from the live capture and its four
counter headers have been updated to the final schema names used by this PR.
JSONL was covered by the exporter and CLI tests.

C96 gVNIC/GVE CSV sample
schema_version,record_type,timestamp_utc,elapsed_seconds,state,transmits,queue_id,tx_packets,tx_bytes,tx_udp,tx_tcp,tx_other,tx_errors,tx_pps,tx_l1_bps,tx_l2_bps,rx_packets,rx_bytes,rx_udp,rx_tcp,rx_other,rx_drops,rx_pps,rx_l1_bps,rx_l2_bps,kernel_queues,kernel_rx_descriptors,kernel_tx_descriptors,rx_dropped,rx_ring_full,rx_fill_ring_empty_descs,rx_invalid_descs,tx_invalid_descs,tx_ring_empty_descs
1,sample,2026-08-10T23:09:51.699887839Z,59.751228,running,false,,0,0,0,0,0,0,0.000000,0.000000,0.000000,1670659716,607644031628,1670659716,0,0,0,47987729.749624,147217033254.869446,139538996494.929657,32,1670662489,0,0,0,1916,0,0,104997015
1,final,2026-08-10T23:10:39.453856667Z,107.505197,complete,false,,0,0,0,0,0,0,0.000000,0.000000,0.000000,2885451046,1049518523936,2885451046,0,0,0,0.000000,0.000000,0.000000,32,2885451046,0,0,0,2408,0,0,181705415

Tested with:

  • go test -count=1 ./...
  • go test -race -count=1 ./...
  • go vet ./...
  • gofmt -l .
  • go build -buildvcs=false ./cmd/wireblast

@m4r1k
m4r1k marked this pull request as ready for review August 11, 2026 10:07
@m4r1k
m4r1k force-pushed the pr/stats-export-v0.3.0 branch from 470295b to 5c97267 Compare August 12, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant