Skip to content

CLI: show Observable signal stats in record list table output #185

Description

@lxsaah

Records registered with .observe() publish live domain-signal gauges
(last/min/max/mean plus a unit) and the AimX protocol already delivers them:
RecordMetadata.signal_stats is populated when the observability feature is
on and the CLI enables that feature, so aimdb record list --format json
includes the stats today. But the default human-readable table drops them: it
only prints Name, Type ID, Buffer Type, Producers, Consumers and Writable.
The most useful live information the protocol carries never reaches the
terminal.

Where to look

  • tools/aimdb-cli/src/output/table.rsformat_records_table, the columns to extend (there's a unit test at the bottom of the file to grow with it)
  • aimdb-core/src/remote/metadata.rsRecordMetadata.signal_stats (Option<Vec<SignalStatsInfo>>)
  • tools/aimdb-cli/src/commands/record.rslist_records, where table vs JSON output is chosen
  • cargo run -p remote-access-demo --bin server — a live test instance at /tmp/aimdb-demo.sock; its Temperature record is registered with .observe(), so aimdb record list --format json shows its gauge and the other records make good - cases

What to do

  • Extend format_records_table with a compact signal column, e.g.
    Signal rendering last unit (min…max, ⌀mean) — records without gauges
    show a dimmed -. Keep the table readable at typical terminal widths;
    a record can carry more than one gauge, so pick a sensible compact form
    (first gauge + count, or one line per gauge).
  • No feature-gating needed on your side: the CLI always builds aimdb-core
    with observability on, so signal_stats is a regular Option field —
    match on Some/None and render the dimmed - for None.

Done when

  • aimdb record list against the remote-access-demo server shows live
    stats for server::Temperature and - for the rest
  • JSON output is unchanged
  • make check is green

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions