Skip to content

Feat/snapshot metrics#1111

Open
ezedike-evan wants to merge 5 commits intodotandev:mainfrom
ezedike-evan:feat/snapshot-metrics
Open

Feat/snapshot metrics#1111
ezedike-evan wants to merge 5 commits intodotandev:mainfrom
ezedike-evan:feat/snapshot-metrics

Conversation

@ezedike-evan
Copy link
Copy Markdown
Contributor

  • Add simulator/src/metrics.rs — SnapshotMetrics accumulates per-op timing
    samples (count, total, min, mean, max) for take_snapshot and
    serialize_snapshot; check_threshold emits tracing::warn! when overhead
    exceeds 30% of total execution time; emit_summary_if_verbose gates profile
    output on --profile/--verbose flag; 10 unit tests
  • Add LedgerSnapshot::serialize_to_base64_map() to snapshot/mod.rs —
    inverse of from_base64_map, encodes all live entries back to base64 XDR;
    respects delta/tombstone CoW logic via existing iter()
  • Update runner.rs — add SnapshotMetrics field to SimHost; add
    timed_take_snapshot(), timed_serialize_snapshot(), finish_metrics()
    wrappers that record Instant::elapsed() into the metrics accumulator

Closes #1001

- Add internal/ui/keys.go — Key type, KeyReader parsing raw stdin bytes
  and ANSI CSI escape sequences; TermSize() with $COLUMNS/$LINES fallback
- Add internal/ui/layout.go — SplitLayout with ToggleFocus (Tab), left/right
  pane widths from SplitRatio, SIGWINCH listener via ListenResize(), side-by-
  side Render() zipping pre-built pane lines with │ divider; focused pane
  marked in border header
- Add internal/ui/trace_view.go — TraceView wiring TreeRenderer to a state
  key-value table; HandleKey dispatches to focused pane; refreshState rebuilds
  table from selected node on every tree navigation event
- Add internal/ui/widgets/state_panel.go — DiffKind (added/removed/changed/same),
  ComputeDiff() diffs ExecutionState.HostState maps; StatePanel renders a
  3-column table (indicator│Key│Old Value│New Value) with colour coding,
  proportional column widths, scrolling, and a Summary() status line
- Add internal/ui/styles.go — centralised ANSI colour constants, Colorize(),
  NoColor global, DefaultBorder; widgets package exports its own copy to
  keep the dependency graph acyclic
- Update internal/ui/layout.go — add PaneDiff pane constant, ShowDiff field,
  ToggleDiff(), MiddleWidth()/RightWidth() for three-pane column arithmetic,
  extend Render() signature to accept leftLines/middleLines/rightLines
- Update internal/ui/trace_view.go — add diffPanel field and etrace param to
  NewTraceView; refreshDiff() wires ExecutionTrace steps to StatePanel.SetStates;
  HandleKey routes KeyDiff to ToggleDiff and PaneDiff nav to panel scroll
- Update internal/ui/keys.go — add KeyDiff constant, map 'd'/'D' to it
- Add simulator/src/metrics.rs — SnapshotMetrics accumulates per-op timing
  samples (count, total, min, mean, max) for take_snapshot and
  serialize_snapshot; check_threshold emits tracing::warn! when overhead
  exceeds 30% of total execution time; emit_summary_if_verbose gates profile
  output on --profile/--verbose flag; 10 unit tests
- Add LedgerSnapshot::serialize_to_base64_map() to snapshot/mod.rs —
  inverse of from_base64_map, encodes all live entries back to base64 XDR;
  respects delta/tombstone CoW logic via existing iter()
- Update runner.rs — add SnapshotMetrics field to SimHost; add
  timed_take_snapshot(), timed_serialize_snapshot(), finish_metrics()
  wrappers that record Instant::elapsed() into the metrics accumulator

Closes dotandev#1001
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@ezedike-evan Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@dotandev
Copy link
Copy Markdown
Owner

dotandev commented Apr 2, 2026

fix conflicts and ci.

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.

[TIME-TRAVEL] [FEAT] Add metrics for snapshot serialization latency

2 participants