@@ -423,6 +423,84 @@ into its own table and join to the rows on `run`: |
423 | 423 |
|
424 | 424 | Its counters follow the same number rule. |
425 | 425 |
|
| 426 | +## Ranked tables and the digest |
| 427 | + |
| 428 | +`top` ranks where a profile's (or, with `--collapsed-input`, any collapsed |
| 429 | +file's) time went, with the selection, filter and transform options of |
| 430 | +`stacks`: |
| 431 | + |
| 432 | +```sh |
| 433 | +java -jar jonoffcpu-correlator.jar top (--profile P | --collapsed-input F) |
| 434 | + [--by boundary|self|method|class|package|pool] [--app REGEX]... [--app-from FILE]... |
| 435 | + [--idle REGEX]... [--idle-from FILE]... [--machinery-from FILE]... |
| 436 | + [--weights observed|estimated] [--limit N] [--format md|json|csv] [--output FILE] |
| 437 | + [--baseline P2 [--units X --baseline-units Y]] |
| 438 | +java -jar jonoffcpu-correlator.jar summarize --profile P [--report R] [--app REGEX]... |
| 439 | + [--idle-from FILE]... [--limit N] [--output-dir D] |
| 440 | +``` |
| 441 | +
|
| 442 | +- **Idle or busy.** An entry is idle when any frame of any of its stacks |
| 443 | + matches an idle pattern, matched as `--exclude` matches. Idle entries are not |
| 444 | + dropped: they get their own table. `--exclude` still removes entries. |
| 445 | +- **Attribution** is computed on the Java stack after `--canonical-names` and |
| 446 | + `--hide`. `boundary` (the default, which needs `--app`) keys a row by the |
| 447 | + deepest application frame and its **blocker**: the entry frame of the longest |
| 448 | + leaf-side run below the boundary that matches the wait machinery |
| 449 | + (`--machinery-from`, default `preset:jvm-wait-machinery`), or the leaf when |
| 450 | + there is none. Busy entries without an application frame go to a table by |
| 451 | + thread pool (the name with digit runs as `#`). `self` is the leaf after the |
| 452 | + transforms, `method`, `class` and `package` count every distinct one in the |
| 453 | + stack once per entry (inclusive), and `pool` is the thread's pool. |
| 454 | +- **Columns**: rank, key (and blocker), seconds to three decimals, share of the |
| 455 | + busy total (of the idle total in the idle table), intervals, estimated |
| 456 | + seconds when the profile's estimate is available, sleeping and run-queue |
| 457 | + seconds when it has the split, the dominant reason, and for boundary rows the |
| 458 | + heaviest root-most application frame (the caller, after `--trim-root` and |
| 459 | + `--root-at`). Rows sort by weight, then key. |
| 460 | +- **Totals** add up: busy and idle make the selection, and application rows and |
| 461 | + the pool table make the busy total. The over-exclusion check counts idle |
| 462 | + entries with a `java.util.concurrent.locks.*.lock*`/`acquire*` or |
| 463 | + `complete_monitor_locking` frame, the waits an idle list may hide by mistake. |
| 464 | +- **Weights.** `observed` by default; `estimated` needs the profile's |
| 465 | + estimate. Under proportional or uniform admission observed time |
| 466 | + under-weights short waits, and the output warns. |
| 467 | +- **`--baseline`** keys both runs by application boundary and gives each row's |
| 468 | + seconds, or seconds per unit of work with `--units`/`--baseline-units`, and |
| 469 | + its share of that run's busy application time. Rows present in one run only |
| 470 | + have the other side empty; rows sort by the larger value, then by the |
| 471 | + absolute delta. It refuses observed weights when both runs have estimates and |
| 472 | + either was sampled, warns when neither has estimates, and warns when the runs' |
| 473 | + unresolved native frames (`/lib/…` paths) differ by more than 10 points of |
| 474 | + busy time, since their time without an application frame is then not |
| 475 | + comparable. |
| 476 | +- **Formats.** `json` is the source: `schemaVersion` 1, `command` (the |
| 477 | + reproduce command), `by`, `unit`, `selection` (every option, with the |
| 478 | + patterns and their sources), `totals`, `rows`, `noApplicationFrame`, `idle` |
| 479 | + (or `comparison`), and `warnings`. `md` and `csv` (one row per table row, |
| 480 | + with a `table` column) are rendered from it. |
| 481 | +
|
| 482 | +Correlation writes the **digest**, `jonoffcpu-summary.json` and |
| 483 | +`jonoffcpu-summary.md`, next to the report unless `--summary-output false` is |
| 484 | +given, with `preset:jvm-idle`, `preset:jvm-wait-machinery`, canonical names and |
| 485 | +no application pattern; `summarize` rewrites it with `--app`. The report's |
| 486 | +`digest` object names the files, or holds the `error` when the digest could not |
| 487 | +be written, which never fails the correlation. The JSON, `schemaVersion` 1: |
| 488 | +
|
| 489 | +| Field | Contents | |
| 490 | +| --- | --- | |
| 491 | +| `profile`, `run`, `estimateAvailable`, `timeSplitAvailable` | What was summarised | |
| 492 | +| `capture` | From the report: session, sampling, source rows, matched, rows outside the selected JFR window, orphan and invalid counts, collector loss counters, handler delay p50/p99/max, reasons and kernel switch-outs, the population estimate's status and accounted loss when present, and degradation steps | |
| 493 | +| `selection` | As in `top --format json` | |
| 494 | +| `whereTheTimeWent` | `top`'s totals: selected, idle, busy, busy with and without an application frame, over-exclusion | |
| 495 | +| `busy`, `idle` | `by` (`boundary` with `--app`, else `self` after collapsing the wait machinery), the reproducing `command`, and the `rows` | |
| 496 | +| `busyNoApplicationFrameByPool` | The pool table (with `--app`), or busy time by pool (without) | |
| 497 | +| `heaviestStacks` | The busy slice with `--root-at` (or `--trim-root-from preset:jvm-infra`) and `--collapse-leaf`, dropped package names: its `lines`, `meanDepth`, the ten heaviest lines, and the `command` | |
| 498 | +| `warnings` | As in `top` | |
| 499 | +
|
| 500 | +Every table is limited to `--limit` rows (default 20), which keeps the Markdown |
| 501 | +of an Apache Pulsar broker's digest under 16 KB. The Markdown is rendered from |
| 502 | +the JSON, so the two cannot disagree, and the same inputs give the same bytes. |
| 503 | +
|
426 | 504 | ## Degradation |
427 | 505 |
|
428 | 506 | A profile is not an audit log. When a capture does not fit the retained-bytes budget, |
|