stormlog.tui.app
Interactive Textual TUI for Stormlog.
Functions
|
Entry-point to launch the Textual application. |
Classes
|
Main Textual application. |
- stormlog.tui.app.run_app()[source]
Entry-point to launch the Textual application.
- Return type:
None
- class stormlog.tui.app.GPUMemoryProfilerTUI(*args, **kwargs)[source]
Bases:
AppMain Textual application.
- Parameters:
args (Any)
kwargs (Any)
- Return type:
Any
- tracker_session: TrackerSession | None
- cli_runner: CLICommandRunner
- monitor_auto_cleanup: bool
- recent_alerts: List[dict[str, Any]]
- CSS = '\n TabbedContent {\n padding: 1;\n }\n\n RichLog {\n height: 1fr;\n border: solid gray;\n }\n\n Button {\n margin: 0 1 1 0;\n height: 5;\n width: auto;\n min-width: 16;\n max-width: 30;\n padding: 1 3;\n content-align: center middle;\n text-style: bold;\n color: #ffffff;\n background: $panel;\n }\n\n Button.-primary {\n color: #ffffff;\n background: $primary;\n border: solid $primary-lighten-1;\n }\n\n Button.-success {\n color: #ffffff;\n background: $success;\n border: solid $success-lighten-1;\n }\n\n Button.-warning {\n color: #000000;\n background: $warning;\n border: solid $warning-lighten-1;\n }\n\n Button.-error {\n color: #ffffff;\n background: $error;\n border: solid $error-lighten-1;\n }\n\n Button:hover {\n opacity: 0.9;\n }\n\n #table-pytorch,\n #table-tensorflow {\n height: 12;\n border: solid gray;\n }\n\n #pytorch-tab,\n #tensorflow-tab {\n layout: vertical;\n }\n\n #cli-tab {\n layout: vertical;\n height: 1fr;\n border: solid gray;\n padding: 0 1;\n }\n\n #cli-buttons-row1,\n #cli-buttons-row2 {\n layout: horizontal;\n content-align: left middle;\n height: auto;\n min-height: 6;\n }\n\n #cli-buttons-row2 {\n margin-top: 0;\n margin-bottom: 1;\n }\n\n #cli-runner {\n layout: horizontal;\n content-align: left middle;\n margin: 1 0;\n }\n\n #cli-command-input {\n width: 1fr;\n padding: 0 1;\n height: 5;\n }\n\n #cli-loader {\n height: 3;\n }\n\n #monitoring-tab {\n layout: vertical;\n height: 1fr;\n border: solid gray;\n padding: 0 1;\n }\n\n #monitor-status {\n margin-bottom: 1;\n }\n\n #monitor-controls-row1,\n #monitor-controls-row2,\n #monitor-controls-row3 {\n layout: horizontal;\n content-align: left middle;\n margin-bottom: 1;\n height: auto;\n min-height: 6;\n }\n\n #monitor-thresholds {\n layout: horizontal;\n content-align: left middle;\n margin-bottom: 1;\n }\n\n #monitor-thresholds Label {\n width: 12;\n }\n\n #monitor-thresholds Input {\n width: 12;\n margin-right: 1;\n }\n\n #monitor-alerts-table {\n height: 8;\n border: solid gray;\n margin-top: 1;\n }\n\n #monitor-stats {\n height: 10;\n border: solid gray;\n }\n\n #monitor-log {\n height: 1fr;\n border: solid gray;\n margin-top: 1;\n }\n\n #visualizations-tab {\n layout: vertical;\n height: 1fr;\n border: solid gray;\n padding: 0 1;\n }\n\n #visual-buttons {\n layout: horizontal;\n content-align: left middle;\n margin-bottom: 1;\n height: auto;\n min-height: 6;\n overflow: hidden;\n }\n\n #timeline-stats {\n height: 8;\n border: solid gray;\n margin-bottom: 1;\n }\n\n #timeline-canvas {\n border: solid gray;\n padding: 1;\n }\n\n #visual-log {\n height: 8;\n border: solid gray;\n margin-top: 1;\n }\n\n #diagnostics-tab {\n layout: vertical;\n height: 1fr;\n border: solid gray;\n padding: 0 1;\n }\n\n #diagnostics-controls-row1,\n #diagnostics-controls-row2 {\n layout: horizontal;\n content-align: left middle;\n margin-bottom: 1;\n height: auto;\n min-height: 6;\n }\n\n #diagnostics-path-input,\n #diagnostics-rank-filter {\n width: 1fr;\n margin-right: 1;\n }\n\n #diagnostics-rank-table {\n height: 12;\n border: solid gray;\n }\n\n #diagnostics-timeline-canvas {\n height: 12;\n border: solid gray;\n padding: 1;\n margin-top: 1;\n }\n\n #diagnostics-anomaly-table {\n height: 8;\n border: solid gray;\n margin-top: 1;\n }\n\n #diagnostics-log {\n height: 8;\n border: solid gray;\n margin-top: 1;\n }\n\n #overview-welcome {\n border: round $primary;\n padding: 1;\n margin: 0 0 1 0;\n background: $panel;\n text-align: center;\n text-style: bold;\n color: $accent;\n min-height: 10;\n content-align: center middle;\n }\n\n #welcome-info {\n border: solid $primary;\n padding: 2;\n margin: 0 0 1 0;\n background: $surface;\n height: auto;\n min-height: 15;\n }\n\n #welcome-info Markdown {\n color: $text;\n }\n\n #pytorch-profile-controls,\n #tensorflow-profile-controls {\n layout: horizontal;\n content-align: left middle;\n margin-top: 1;\n height: auto;\n min-height: 6;\n }\n\n #pytorch-profile-table,\n #tensorflow-profile-table {\n height: 12;\n border: solid gray;\n margin-top: 1;\n }\n'
- BINDINGS = [('q', 'quit', 'Quit'), ('r', 'refresh_overview', 'Refresh Overview'), ('f', 'focus_log', 'Focus Log'), ('g', 'log_gpumemprof_help', 'gpumemprof info'), ('t', 'log_tfmemprof_help', 'tfmemprof info')]
- async on_button_pressed(event)[source]
- Parameters:
event (textual.widgets.Button.Pressed)
- Return type:
None
- on_data_table_row_selected(event)[source]
- Parameters:
event (textual.widgets.DataTable.RowSelected)
- Return type:
None
- async on_input_submitted(event)[source]
- Parameters:
event (textual.widgets.Input.Submitted)
- Return type:
None
- log_monitor_message(title, content)[source]
- Parameters:
title (str)
content (str)
- Return type:
None