> 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/latreport.md).

# latreport

The `latreport` command generates latency reports from binary latency files produced by [`StatsLatencyWriter`](https://build.neeveresearch.com/rumi/javadoc/LATEST/index.html?com/neeve/stats/StatsLatencyWriter.html). It reads the binary data, computes percentile breakdowns per sample bucket, and writes the results to CSV or Excel format.

## Usage

```bash
rumi tools latreport [options]
```

## Options

| Option                      | Description                                                                           |
| --------------------------- | ------------------------------------------------------------------------------------- |
| `-h, --help`                | Show help message                                                                     |
| `-f, --inputfile <file>`    | **(Required)** Path to the input binary latency file                                  |
| `-o, --outputfile <file>`   | Output file path (default: same directory and base name as input file)                |
| `-t, --title <title>`       | Report title (default: output file base name)                                         |
| `-w, --warmup <count>`      | Number of initial data points to skip as warmup                                       |
| `-m, --maxval <value>`      | Violation threshold value. Data points exceeding this value are counted as violations |
| `-s, --samplesize <size>`   | Number of data points per sample bucket                                               |
| `-c, --cfg <file>`          | Path to an XML configuration file for advanced settings                               |
| `--bucketcnt <count>`       | Number of frequency map buckets for histogram generation                              |
| `--stddev`                  | Enable standard deviation calculation                                                 |
| `--processors <count>`      | Number of reader threads for parallel processing                                      |
| `--writepoint <value>`      | Write point interval for filtering write-induced latency spikes                       |
| `--prewritewarmup <count>`  | Number of data points to exclude before each write point                              |
| `--postwritewarmup <count>` | Number of data points to exclude after each write point                               |
| `--format <csv\|xlsx>`      | Output format (default: `csv`)                                                        |

## Examples

### Basic Report

Generate a CSV report from a latency file:

```bash
rumi tools latreport -f /path/to/test.latency
```

Output:

```
Generating latency report from: /path/to/test.latency
Latency report generated: /path/to/test.csv
```

The output file is created in the same directory as the input file, with the same base name and a `.csv` extension.

### Custom Output File

Specify an output file path:

```bash
rumi tools latreport -f /path/to/test.latency -o /path/to/report
```

The appropriate extension (`.csv` or `.xlsx`) is appended automatically.

### With Warmup and Sample Size

Skip the first 100,000 data points as warmup and use 10,000-point sample buckets:

```bash
rumi tools latreport -f /path/to/test.latency \
  -w 100000 \
  -s 10000 \
  -t "Performance Test Report"
```

### Excel Output

Generate an Excel report with charts and histograms:

```bash
rumi tools latreport -f /path/to/test.latency --format xlsx
```

### Write Point Filtering

When the application under test performs periodic writes (e.g., every 1,000,000 messages), the latency around the write point is typically elevated. Use `--writepoint`, `--prewritewarmup`, and `--postwritewarmup` to exclude these data points from the report:

```bash
rumi tools latreport -f /path/to/test.latency \
  --writepoint 1000000 \
  --prewritewarmup 1000 \
  --postwritewarmup 500
```

## CSV Output Format

The CSV output contains one header row followed by one row per sample bucket. Each row includes:

| Column       | Description                                             |
| ------------ | ------------------------------------------------------- |
| Title        | Sample bucket identifier (start row - end row)          |
| Mean         | Average latency for the bucket                          |
| StdDev       | Standard deviation (if enabled)                         |
| 50thP        | 50th percentile (median)                                |
| 75thP        | 75th percentile                                         |
| 90thP        | 90th percentile                                         |
| 99thP        | 99th percentile                                         |
| 99.9thP      | 99.9th percentile                                       |
| 99.99thP     | 99.99th percentile                                      |
| 99.999thP    | 99.999th percentile                                     |
| 99.9999thP   | 99.9999th percentile                                    |
| Max          | Maximum value in the bucket                             |
| NoViolations | Number of data points exceeding the violation threshold |

## Excel Output Format

The Excel output (`--format xlsx`) includes:

* **Latencies sheet** - Percentile data (same columns as CSV), run metadata, violation charts, and configurable scatter plots
* **Histogram sheet** - Latency frequency distribution with bar charts showing both linear and logarithmic scales

## Configuration File

For advanced configuration, use the `-c` option to specify an XML configuration file. The configuration file controls default values for input processing, output formatting, and graph generation.

Key configuration sections:

| Section                            | Description                                        |
| ---------------------------------- | -------------------------------------------------- |
| `Input.Sampling.SampleSize`        | Default sample bucket size                         |
| `Input.Sampling.MaxDataPointValue` | Default violation threshold                        |
| `Input.Sampling.WarmupDataPoints`  | Default warmup count                               |
| `Input.Reading.BufferSize`         | File read buffer size                              |
| `Input.Reading.ReaderThreads`      | Default thread count for parallel processing       |
| `Output.Format`                    | Default output format (`csv` or `xlsx`)            |
| `Output.Control.Buckets`           | Default frequency histogram bucket count           |
| `Output.Control.IncludeStdDev`     | Whether to calculate standard deviation by default |
| `Output.Graphing.Graph`            | Graph definitions for Excel output                 |

Command-line options override configuration file values.

## Binary File Formats

The tool automatically detects the latency file format:

* **V1 format** - 8 bytes per entry (4-byte index + 4-byte latency value)
* **V2 format** - 4 bytes per entry (latency value only, index inferred from position)

## See Also

* [tools](/rumi-cli/commands/tools.md) - Tools overview
* [Engine Stats](/rumi-core/guides/operating-applications/monitoring/engine-statistics.md) - Engine metrics and timing data


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.rumi.systems/rumi-cli/commands/tools/latreport.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
