> For the complete documentation index, see [llms.txt](https://docs.rumi.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rumi.systems/rumi-cli/commands/tools/txnstats/dump.md).

# dump

The `dump` subcommand reads a transaction stats log and outputs calculated timing differences to a CSV file. The output includes an aggregates section with statistical summaries, followed by detailed per-message timings.

## Usage

```bash
rumi tools txnstats dump [options]
```

## Options

| Option                | Description                                                             |
| --------------------- | ----------------------------------------------------------------------- |
| `-l, --log <file>`    | **(Required)** Path to the transaction stats log file (`.txnstats.log`) |
| `-o, --output <file>` | Output CSV file (default: `txnstats-dump.csv`)                          |

## Example

```bash
rumi tools txnstats dump -l /path/to/myapp.txnstats.log -o stats.csv
```

Output:

```
Dumping transaction stats from: /path/to/myapp.txnstats.log
Pass 1: Collecting aggregates...
Pass 2: Writing output...
Wrote 14093978 rows from 7178707 transactions to: /path/to/stats.csv
```

## Transaction Structure

A Rumi transaction processes messages as follows:

1. **Inbound Messages**: One or more messages received from the messaging bus trigger the transaction
2. **Processing**: Each inbound message is processed by the application's message handler, which may send outbound messages
3. **Outbound Messages**: Messages sent during processing are held until commit
4. **Commit**: The transaction commits (persists to the store and replicates to backup cluster members), then releases outbound messages

## CSV Output Format

The output contains two sections with identical column structure:

1. **Aggregates Section**: Statistical summaries for each timing column
2. **Details Section**: Individual timing rows for each inbound-outbound message pair

All timing values are calculated differences in microseconds rather than raw timestamps. The column order is: **stat → inbound timestamp/timings → transaction timestamp/timings → outbound timestamp/timings**.

### Aggregates Section

The aggregates section uses the same column headers as the details section. The stat label (count, min, etc.) appears in the `stat` column (column A), ensuring timing data columns align between the aggregates and details sections.

| Metric   | Description                                | Format           |
| -------- | ------------------------------------------ | ---------------- |
| `count`  | Total number of data points for the column | Integer          |
| `min`    | Minimum value (exact)                      | Integer          |
| `max`    | Maximum value (exact)                      | Integer          |
| `avg`    | Average value                              | 2 decimal places |
| `median` | Median value (50th percentile)             | 2 decimal places |
| `p99`    | 99th percentile                            | 2 decimal places |
| `p99.9`  | 99.9th percentile                          | 2 decimal places |
| `p99.99` | 99.99th percentile                         | 2 decimal places |

### Details Section

Each row in the details section represents an inbound-outbound message pair within a transaction:

* The `stat` column is empty in the details section
* Timestamp columns (`inTs`, `txnTs`, `outTs`) contain raw microsecond timestamps for correlation
* If an inbound message produces multiple outbound messages, the inbound timings appear only on the first row
* Transaction commit timings and `txnTs` appear only on the last row of each transaction

### Inbound Message Timings

| Column    | Description                                            | Calculation                                                                                                                                           |
| --------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `inTs`    | Inbound message timestamp                              | First available of: SMAPostWireTsMicros, SMAPreDeserializeTsMicros, SMAPostDeserializeTsMicros, AEPInputQueueOfferTsMicros, AEPInputQueuePollTsMicros |
| `inSeq`   | Inbound message sequence number within the transaction | -                                                                                                                                                     |
| `in.w2d`  | Wire to pre-deserialize time                           | SMAPreDeserializeTsMicros - SMAPostWireTsMicros                                                                                                       |
| `in.d`    | Deserialize time                                       | SMAPostDeserializeTsMicros - SMAPreDeserializeTsMicros                                                                                                |
| `in.d2o`  | Deserialize to queue offer time                        | AEPInputQueueOfferTsMicros - SMAPostDeserializeTsMicros                                                                                               |
| `in.o2p`  | Queue latency (time in input queue)                    | AEPInputQueuePollTsMicros - AEPInputQueueOfferTsMicros                                                                                                |
| `in.pre`  | Pre-processing time                                    | AEPPreProcessingTsMicros - AEPInputQueuePollTsMicros                                                                                                  |
| `in.proc` | Processing time (in message handler)                   | AEPPostProcessingTsMicros - AEPPreProcessingTsMicros                                                                                                  |

### Transaction Commit Timings

These columns only have values on the last row of each transaction:

| Column             | Description                  | Calculation                                              |
| ------------------ | ---------------------------- | -------------------------------------------------------- |
| `txnTs`            | Transaction timestamp        | commitStartTsMicros                                      |
| `txn.store.start`  | Store commit initiation time | storeCommitStartedTsMicros - storeCommitStartTsMicros    |
| `txn.store.commit` | Store commit duration        | storeCommitCompleteTsMicros - storeCommitStartedTsMicros |
| `txn.send.start`   | Send commit initiation time  | sendCommitStartedTsMicros - sendCommitStartTsMicros      |
| `txn.send.commit`  | Send commit duration         | sendCommitCompleteTsMicros - sendCommitStartedTsMicros   |
| `txn.commit`       | Total commit time            | commitCompleteTsMicros - commitStartTsMicros             |

### Outbound Message Timings

| Column    | Description                                             | Calculation                                        |
| --------- | ------------------------------------------------------- | -------------------------------------------------- |
| `outTs`   | Outbound message timestamp                              | AEPSendEnterTsMicros                               |
| `outSeq`  | Outbound message sequence number within the transaction | -                                                  |
| `out.sq`  | Send queue time (enqueuing outbound message)            | AEPSendExitTsMicros - AEPSendEnterTsMicros         |
| `out.o2s` | Commit to pre-serialize time                            | SMAPreSerializeTsMicros - AEPSendCommitTsMicros    |
| `out.s`   | Serialize time                                          | SMAPostSerializeTsMicros - SMAPreSerializeTsMicros |
| `out.s2w` | Serialize to wire time                                  | SMAPreWireTsMicros - SMAPostSerializeTsMicros      |
| `out.ws`  | Wire send time                                          | SMAPostWireTsMicros - SMAPreWireTsMicros           |
| `out.snd` | Total send time                                         | SMASendEndTsMicros - SMASendStartTsMicros          |

## Example Output

```csv
stat,inTs,inSeq,in.w2d,in.d,in.d2o,in.o2p,in.pre,in.proc,txnTs,txn.store.start,txn.store.commit,txn.send.start,txn.send.commit,txn.commit,outTs,outSeq,out.sq,out.o2s,out.s,out.s2w,out.ws,out.snd
count,,,0,0,0,7178697,7178699,7178699,,7178707,7178702,7178701,7178642,7178698,,,11783360,0,0,0,11783360,11783360
min,,,,,,0,0,0,,1,0,0,0,4,,,1,,,,2,4
max,,,,,,33199248,9327,800963,,908925,614674,105959,79688603,79689001,,,12767,,,,477673,477703
avg,,,,,,290305.71,2.49,1186.77,,13.80,499.01,0.98,1166468.38,1166980.81,,,5.62,,,,5.49,14.15
median,,,,,,171434.00,2.00,113.00,,8.00,361.00,1.00,164833.00,164335.00,,,6.00,,,,5.00,13.00
p99,,,,,,1600653.95,10.00,4077.00,,16.00,959.01,4.00,25677086.55,24724851.33,,,10.00,,,,10.00,29.00
p99.9,,,,,,3514428.15,19.00,5514.00,,48.00,40751.76,11.00,69352346.00,68399407.27,,,20.00,,,,212.00,220.00
p99.99,,,,,,21552886.94,56.00,36832.12,,457.00,275857.11,51.00,78541328.07,78678016.13,,,37.00,,,,285.00,310.00

stat,inTs,inSeq,in.w2d,in.d,in.d2o,in.o2p,in.pre,in.proc,txnTs,txn.store.start,txn.store.commit,txn.send.start,txn.send.commit,txn.commit,outTs,outSeq,out.sq,out.o2s,out.s,out.s2w,out.ws,out.snd
,1767665129176735,1,,,,,9327,107249,,,,,,,1767665129238527,1,203,,,,42,2386
,,,,,,,,,,,,,,,1767665129239768,2,48,,,,26,476
,,,,,,,,,,,,,,,1767665129240805,3,59,,,,34,416
...
,,,,,,,,,1767665129293331,3560,6,31,1877294,1883116,1767665129291085,27,33,,,,25,56
,1767665129297031,1,,,,,108,14018,1767665129311161,543,3,8,1864781,1865389,1767665129297166,1,27,,,,23,50
,1767665128984749,1,,,,326997,1423,131241,1767665129444424,455,4,14,1731625,1734625,,,,,,,,
```

In this example:

* **Aggregates section**: Same header as details, with stat labels in `stat` column (column A)
  * count, min, max shown as integers
  * avg, median, percentiles shown with 2 decimal places
  * Timestamp columns (`inTs`, `txnTs`, `outTs`) are empty in aggregates
* **Details section**: Individual transaction rows
  * Row 1: Inbound message 1 with `inTs` timestamp, timings, and first outbound message with `outTs` timestamp
  * Rows 2-3: Additional outbound messages with `outTs` timestamps, without repeating inbound timings
  * Last row of transaction 1: Outbound message 27 with `txnTs` timestamp and transaction commit timings
  * Next transaction: Inbound-only rows have empty outbound columns

## Compatibility

{% hint style="info" %}
**3.x Compatibility**: For logs created with Rumi 3.x, use the `--3x` flag before the command:

```bash
rumi --3x tools txnstats dump -l /path/to/myapp.txnstats.log
```

{% endhint %}

## See Also

* [txnstats](/rumi-cli/commands/tools/txnstats.md) - Transaction stats tools overview
* [txnstats query](/rumi-cli/commands/tools/txnstats/query.md) - Query logs and join with transaction stats
* [Configuring Per-Transaction Statistics](/rumi-core/guides/developing-applications/configuring-the-runtime/monitoring/per-transaction-statistics.md) - How to enable per-transaction stats logging
