Skip to content

Add interactive mrun monitor improvements#4

Draft
svadapalli1994 wants to merge 51 commits into
mainfrom
feature-monitor
Draft

Add interactive mrun monitor improvements#4
svadapalli1994 wants to merge 51 commits into
mainfrom
feature-monitor

Conversation

@svadapalli1994
Copy link
Copy Markdown
Collaborator

Summary

  • Adds and hardens the interactive mrun --monitor experience for local MongoDB deployments.
  • Keeps the implementation spec in doc/feature-monitor-guide.md as the reviewer-facing architecture and behavior guide.
  • Updates user-facing docs and CLI help so controls match the final monitor behavior.

Development history

  • Added the top-level mrun --monitor path and kept it separate from normal command dispatch.
  • Added mrun-managed process discovery from .mrun_startup.
  • Added --monitor --all and in-dashboard scope toggling for all local mongod and mongos processes.
  • Added auth and TLS metadata loading from startup data.
  • Added explicit monitor credential overrides for sampling and shell handoff.
  • Added CPU, memory, network, disk, and log monitor panes.
  • Added pane focus, full-pane zoom, and cached redraws for cursor-only actions.
  • Added direct tty escape-sequence parsing so arrow keys work reliably.
  • Added CPU process selection, raw/normalized CPU display, and optional thread view.
  • Added thread-count fallback when detailed thread timing is denied.
  • Added MongoDB role detection from serverStatus(), with hello and isMaster fallbacks.
  • Added role columns across CPU, memory, network, disk, and currentOp rows.
  • Added the two-column layout with a left metric stack and right-side log/currentOp activity pane.
  • Added strict log selection by visible index or displayed port, with invalid-input re-prompts.
  • Added external-process handling so logs for non-mrun processes require an explicit user-provided path.
  • Added bounded log tailing, recent-file seeding, timestamp merge ordering, pause/resume, and stable cursor/viewport behavior.
  • Added log severity coloring, selected/yanked row priority handling, OSC 52 copy support, and syntax-colored Pretty JSON.
  • Added local fuzzy and structured log filtering for slow operations, commands, components, severity, ports, and messages.
  • Added on-demand top-N currentOp sampling in the log activity pane.
  • Added formatted and raw BSON-safe currentOp display modes.
  • Added currentOp namespace filtering, active namespace selection, Pretty JSON, yank support, source-node selection, and pause/resume.
  • Added currentOp command compatibility fallbacks for supported MongoDB versions that reject optional fields.
  • Added M key mongosh handoff with primary, selected-node, seed-list, first-node, and custom-URI targets.
  • Added secure mongosh argv construction that reuses monitor auth/TLS options without exposing password values in argv.
  • Added expanded serverStatus() mode with Disk, Network, Storage, and Other Subsystems panels.
  • Added raw serverStatus() retention for inspectable promoted subsystem panes.
  • Added selectable undisplayed subsystem browsing, Enter-to-promote behavior, round-robin promotion targets, and r reset.
  • Added rate warm-up labels before a previous counter sample exists.
  • Added rate-window display after a baseline exists.
  • Added counter-reset clamping so derived rates do not go negative.
  • Added ANSI-aware rendering primitives: neutral borders, pane-colored bold titles and table headers, aligned tables, stable left padding, and clipped footers.
  • Added focused tests for monitor CLI routing, sampling, rendering, prompts, key handling, currentOp behavior, expanded status behavior, log filtering, and failure/status messages.
  • Cleaned generated development artifacts out of the branch; Graphify/helper output was moved to /tmp/mongorun-side-scripts, and local runtime data/ was deleted.

Implementation spec

  • doc/feature-monitor-guide.md documents the final monitor architecture, runtime flows, keyboard controls, data models, failure behavior, test coverage, and manual review checklist.
  • The guide was cleaned to match this PR's scope and no longer documents moved helper scripts as part of the feature.

Files changed

  • mrun/monitor.py
  • mrun/mrun.py
  • mrun/test/test_monitor.py
  • doc/feature-monitor-guide.md
  • doc/monitor.md
  • doc/mrun.rst

Validation

  • uv run --isolated --python python3.11 --no-python-downloads --with-requirements requirements.txt --with-requirements test-requirements.txt pytest mrun/test/test_monitor.py
  • git diff --check

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.

1 participant