Skip to content

Add interactive subscription dashboard - #931

Open
DavidBadura wants to merge 4 commits into
4.0.xfrom
DavidBadura/symfony-tui-subscription-cli
Open

DavidBadura wants to merge 4 commits into
4.0.xfrom
DavidBadura/symfony-tui-subscription-cli

Conversation

@DavidBadura

@DavidBadura DavidBadura commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

This adds event-sourcing:subscription:dashboard, a k9s like terminal UI built on the new symfony/tui component. It shows all subscriptions in a live updating table with status, progress and lag, has a describe view with the error and stack trace, and lets you run setup, boot, run, pause, reactivate, refresh, teardown, remove and rebuild on the selected or marked subscriptions. Only actions that fit the status are offered, and the destructive ones ask for confirmation.

The actions run the existing subscription commands in a separate process, so the UI keeps updating while a long boot or rebuild is running. If those commands are not registered in the same console application, or with --in-process, they run in the dashboard process instead. For this the run command got a new --stop-when-finished option, which stops the worker as soon as all messages are processed.

symfony/tui needs PHP 8.4, so it is only added as dev dependency and suggestion. The command prints an error if it is missing. The unit workflow removes it for PHP 8.2/8.3 and lowest dependencies (otherwise it would pull in symfony/string 8 and we would no longer test against console 5.4), and the tests are skipped in that case.

To try it out, run bin/subscription-dashboard-demo. It starts the dashboard with an in-memory store, a few example subscribers and a background producer and worker, so the positions and lags change live.

The whole thing is marked as experimental, since symfony/tui itself is experimental too.

A k9s like terminal UI built on symfony/tui to monitor and manage
subscriptions. It shows status, progress and lag in a live updating
table, has a describe view with the error and stack trace, and runs the
subscription commands (setup, boot, run, pause, reactivate, refresh,
teardown, remove, rebuild) on the selected or marked subscriptions.

symfony/tui requires PHP 8.4, so it is only a dev dependency and a
suggestion. The unit workflow removes it for PHP 8.2/8.3 and lowest
dependencies, and the tests are skipped when it is missing.

bin/subscription-dashboard-demo starts the dashboard with an in-memory
store and a few example subscribers.
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Hello 👋

here is the most recent benchmark result:

SplitStreamBench
================

+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                         | time (kde mode)                                     | memory                                     |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                 | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad10000Events () | 3.123ms (±0.00%)   | 3.181ms (±0.00%)   | -1.83%    | 36.289mb        | 36.296mb   | -0.02%      |
| benchSave10000Events () | 483.997ms (±0.00%) | 497.227ms (±0.00%) | -2.66%    | 36.424mb        | 35.966mb   | +1.27%      |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SimpleSetupTaggableStoreBench
=============================

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad1Event ()                     | 1.122ms (±0.00%)   | 1.108ms (±0.00%)   | +1.30%    | 36.313mb        | 36.313mb   | 0.00%       |
| benchLoad10000Events ()                | 77.098ms (±0.00%)  | 78.095ms (±0.00%)  | -1.28%    | 36.313mb        | 36.313mb   | 0.00%       |
| benchSave1Event ()                     | 1.747ms (±0.00%)   | 1.703ms (±0.00%)   | +2.58%    | 36.313mb        | 36.313mb   | 0.00%       |
| benchSave10000Events ()                | 338.167ms (±0.00%) | 335.999ms (±0.00%) | +0.65%    | 36.313mb        | 36.313mb   | 0.00%       |
| benchSave10000Aggregates ()            | 10.434s (±0.00%)   | 10.368s (±0.00%)   | +0.64%    | 36.313mb        | 36.313mb   | 0.00%       |
| benchSave10000AggregatesTransaction () | 7.280s (±0.00%)    | 7.255s (±0.00%)    | +0.34%    | 36.313mb        | 36.313mb   | 0.00%       |
| benchAppend1Event ()                   | 1.732ms (±0.00%)   | 1.744ms (±0.00%)   | -0.67%    | 36.313mb        | 36.313mb   | 0.00%       |
| benchAppend100Events ()                | 8.657ms (±0.00%)   | 8.645ms (±0.00%)   | +0.15%    | 36.313mb        | 36.313mb   | 0.00%       |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SubscriptionEngineBench
=======================

+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
|                           | time (kde mode)                               | memory                                     |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
| subject                   | Tag: <current>  | Tag: base       | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
| benchHandle10000Events () | 3.462s (±0.00%) | 3.504s (±0.00%) | -1.20%    | 48.302mb        | 48.302mb   | 0.00%       |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+

NoopSubscriptionEngineBench
===========================

+---------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                           | time (kde mode)                                     | memory                                     |
+---------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                   | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+---------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchHandle10000Events () | 111.706ms (±0.00%) | 108.890ms (±0.00%) | +2.59%    | 48.302mb        | 48.302mb   | 0.00%       |
+---------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SimpleSetupStreamStoreBench
===========================

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad1Event ()                     | 1.124ms (±0.00%)   | 1.113ms (±0.00%)   | +1.02%    | 35.147mb        | 35.147mb   | 0.00%       |
| benchLoad10000Events ()                | 74.156ms (±0.00%)  | 73.886ms (±0.00%)  | +0.37%    | 35.147mb        | 35.147mb   | 0.00%       |
| benchSave1Event ()                     | 1.527ms (±0.00%)   | 1.517ms (±0.00%)   | +0.64%    | 35.147mb        | 35.147mb   | 0.00%       |
| benchSave10000Events ()                | 294.227ms (±0.00%) | 309.609ms (±0.00%) | -4.97%    | 35.147mb        | 35.147mb   | 0.00%       |
| benchSave10000Aggregates ()            | 10.245s (±0.00%)   | 10.303s (±0.00%)   | -0.57%    | 35.147mb        | 35.147mb   | 0.00%       |
| benchSave10000AggregatesTransaction () | 7.109s (±0.00%)    | 7.138s (±0.00%)    | -0.40%    | 35.147mb        | 35.147mb   | 0.00%       |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SubscriptionEngineBatchBench
============================

+---------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                           | time (kde mode)                                     | memory                                     |
+---------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                   | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+---------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchHandle10000Events () | 117.637ms (±0.00%) | 115.415ms (±0.00%) | +1.93%    | 35.727mb        | 35.727mb   | 0.00%       |
+---------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

DynamicConsistencyBoundaryBench
===============================

+------------------------------------------------+--------------------+-------------------+-----------+-----------------+------------+-------------+
|                                                | time (kde mode)                                    | memory                                     |
+------------------------------------------------+--------------------+-------------------+-----------+-----------------+------------+-------------+
| subject                                        | Tag: <current>     | Tag: base         | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+------------------------------------------------+--------------------+-------------------+-----------+-----------------+------------+-------------+
| benchDecisionModelSmall ()                     | 1.771ms (±0.00%)   | 1.754ms (±0.00%)  | +0.96%    | 13.862mb        | 13.862mb   | 0.00%       |
| benchDecisionModelComposite ()                 | 19.313ms (±0.00%)  | 18.315ms (±0.00%) | +5.45%    | 13.862mb        | 13.862mb   | 0.00%       |
| benchDecisionModel10000Events ()               | 101.485ms (±0.00%) | 99.759ms (±0.00%) | +1.73%    | 13.862mb        | 13.862mb   | 0.00%       |
| benchDecisionModel10000EventsWithCheckpoint () | 14.146ms (±0.00%)  | 13.113ms (±0.00%) | +7.88%    | 13.862mb        | 13.862mb   | 0.00%       |
| benchDecisionModelOnlyLastEvent ()             | 1.485ms (±0.00%)   | 1.476ms (±0.00%)  | +0.65%    | 13.862mb        | 13.862mb   | 0.00%       |
| benchDecideAndAppend ()                        | 32.998ms (±0.00%)  | 35.657ms (±0.00%) | -7.46%    | 13.862mb        | 13.862mb   | 0.00%       |
| benchAppendWithCondition ()                    | 3.946ms (±0.00%)   | 3.971ms (±0.00%)  | -0.63%    | 13.862mb        | 13.862mb   | 0.00%       |
+------------------------------------------------+--------------------+-------------------+-----------+-----------------+------------+-------------+

PersonalDataBench
=================

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad1Event ()                     | 1.054ms (±0.00%)   | 1.051ms (±0.00%)   | +0.36%    | 37.009mb        | 37.009mb   | 0.00%       |
| benchLoad10000Events ()                | 228.680ms (±0.00%) | 225.325ms (±0.00%) | +1.49%    | 37.009mb        | 37.009mb   | 0.00%       |
| benchSave1Event ()                     | 2.361ms (±0.00%)   | 2.415ms (±0.00%)   | -2.26%    | 37.009mb        | 37.009mb   | 0.00%       |
| benchSave10000Events ()                | 474.571ms (±0.00%) | 476.497ms (±0.00%) | -0.40%    | 37.064mb        | 37.064mb   | +0.00%      |
| benchSave10000Aggregates ()            | 15.674s (±0.00%)   | 15.678s (±0.00%)   | -0.02%    | 37.009mb        | 37.009mb   | 0.00%       |
| benchSave10000AggregatesTransaction () | 12.522s (±0.00%)   | 12.500s (±0.00%)   | +0.18%    | 37.009mb        | 37.009mb   | 0.00%       |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SnapshotsBench
==============

+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                   | memory                                     |
+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>    | Tag: base         | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| benchLoad10000EventsMissingSnapshot () | 75.767ms (±0.00%) | 74.395ms (±0.00%) | +1.84%    | 35.218mb        | 35.218mb   | 0.00%       |
| benchLoad10000Events ()                | 1.289ms (±0.00%)  | 1.296ms (±0.00%)  | -0.57%    | 35.218mb        | 35.218mb   | 0.00%       |
+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+

CommandToQueryBench
===================

+----------------+------------------+------------------+-----------+-----------------+------------+-------------+
|                | time (kde mode)                                 | memory                                     |
+----------------+------------------+------------------+-----------+-----------------+------------+-------------+
| subject        | Tag: <current>   | Tag: base        | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------+------------------+------------------+-----------+-----------------+------------+-------------+
| benchCreate () | 4.260ms (±0.00%) | 4.242ms (±0.00%) | +0.44%    | 5.061mb         | 5.061mb    | 0.00%       |
| benchUpdate () | 5.487ms (±0.00%) | 5.191ms (±0.00%) | +5.71%    | 5.757mb         | 5.757mb    | 0.00%       |
| benchBoth ()   | 8.889ms (±0.00%) | 9.156ms (±0.00%) | -2.91%    | 5.213mb         | 5.213mb    | 0.00%       |
+----------------+------------------+------------------+-----------+-----------------+------------+-------------+

This comment gets update everytime a new commit comes in!

*
* @experimental
*/
final class SubscriptionDashboard

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would say to mark everything besides the command itself also internal, no? Or do you want this to be an official api/entry points for users?

The actions are now executed with the existing subscription commands in
a separate process, so the dashboard keeps rendering and reacting to
input while e.g. a long boot or rebuild is running. A spinner shows the
running action, and a second action has to wait until it is done.

The process is polled from the event loop and its output goes into a
temporary file, so this also works on windows where revolt can not wait
on pipes.

If the subscription commands are not registered in the same console
application (like in the demo), or with --in-process, the actions still
run in the dashboard process.
The run worker stops as soon as all messages are processed. The
dashboard uses it, so a run started there catches up completely instead
of processing only one batch.
The rate is calculated from the positions of the last reloads, averaged
over ten seconds. It is shown as its own column, in the describe view
together with an estimate of the remaining time, and for the head in
the header.
@DanielBadura DanielBadura added this to the 4.0.0 milestone Oct 9, 2026
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.

2 participants