Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,8 @@ GO_TARGETS = [
"//pkg/kv/kvserver/asim/state:state_test",
"//pkg/kv/kvserver/asim/storerebalancer:storerebalancer",
"//pkg/kv/kvserver/asim/storerebalancer:storerebalancer_test",
"//pkg/kv/kvserver/asim/tests/cmd/asimview:asimview",
"//pkg/kv/kvserver/asim/tests/cmd/asimview:asimview_lib",
"//pkg/kv/kvserver/asim/tests:tests",
"//pkg/kv/kvserver/asim/tests:tests_test",
"//pkg/kv/kvserver/asim/workload:workload",
Expand Down
22 changes: 22 additions & 0 deletions pkg/kv/kvserver/asim/tests/cmd/asimview/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "asimview_lib",
srcs = [
"main.go",
"sha_compare.go",
],
embedsrcs = [
"mma.png",
"sha_compare.html",
"viewer.html",
],
importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/asim/tests/cmd/asimview",
visibility = ["//visibility:private"],
)

go_binary(
name = "asimview",
embed = [":asimview_lib"],
visibility = ["//visibility:public"],
)
47 changes: 47 additions & 0 deletions pkg/kv/kvserver/asim/tests/cmd/asimview/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# ASIM Test Results Viewer

Interactive web viewer for ASIM test JSON output files with fuzzy search and multi-file comparison.

## Usage

### Regular File Viewer Mode

```bash
# Default: serves files from repo's testdata/generated directory
go run .

# Or specify a custom directory
go run . /path/to/json/files

# Custom port
go run . -port 8081
```

Then open http://localhost:8080 in your browser.

### SHA Comparison Mode

```bash
# Enable SHA comparison mode
go run . -sha-compare

# With custom port
go run . -sha-compare -port 8081
```

Then open http://localhost:8080 in your browser. This mode allows you to:

1. **Generate test data for different Git SHAs**: Enter two commit SHAs and click "Generate Comparison" to run ASIM tests for both commits
2. **Compare results side-by-side**: Select test files to see JSON data plotted side-by-side for visual comparison
3. **Automatic Git workflow**: The tool handles switching between SHAs, running tests, and storing results automatically

**Note**: SHA comparison mode requires a clean Git working directory and will temporarily switch between commits to generate test data.

## Features

- **Fuzzy Search**: Type any part of test name or file name to filter
- **Multiple Selection**: Select multiple test files to compare side-by-side
- **Synchronized Zoom**: Drag to zoom on any chart, all charts sync automatically
- **Copy Data**: Click the clipboard button on any chart to copy its timeseries data as JSON
- **Auto-discovery**: Recursively finds all JSON files in the specified directory
- **Local Storage**: Remembers your last selection and zoom state. (Can refresh the browser window to update loaded files).
Loading
Loading