Skip to content

feature: abctl: text-based visualization of cortex event volume and performance #873

Closed

Description

@esnible

Feature Description

I don't know how much LLM and tools my agents are using.

I can view individual events chronologically in the abctl event picker, but it is hard to infer usage over time from that view.

Proposed Solution

Add a "usage" or "metrics" screen to the abctl TUI.

The screen would provide simple bar or line graphs of volume and response time, with the horizontal axis being wall clock time.

  • The screen will cycle between show volume and time details for a single session or all sessions
  • The screen will cycle between a view of the last five minutes, the last hour, and longer (if historical info is there)
  • The screen will perhaps use ANSI color or texture to allow the user to distinguish between traffic for a METHOD (e.g. claude-sonnet), a STATUS (200 vs 50x), or a PLUGIN.

Want to contribute?

  • I would like to work on this issue.

Additional Context

See #872 for inspirational Grafana dashboard showing the kinds of metrics Claude users like to see.

Activity

  1. self-assigned this
    on Sep 4, 2026
  2. added
    enhancement
    on Sep 4, 2026
  3. esnible commented on Sep 4, 2026

    @esnible
    MemberAuthor

    Note: currently Cortex limits the historical information it offers to abctl in three ways:

    1. Per-session event cap — default 500. FIFO, oldest first
    2. Session TTL — default 30m. isExpired drops whole sessions
    3. Session count cap — default 100. discards whole sessions when too many exist.

    abctl's Snapshot refetch replaces the list of events.

    abctl could be modified to keep events, or the counts and sums needed for visualization. However, this means that exiting abctl and restarting it would lose data, and that different users or different abctl sessions could show different data for the same Cortex instance.

    Cortex offers a /v1/events stream, but it only streams new events, not historical ones.

    To get around those limitations we could add a /v1/metrics endpoint to Cortex and let it accumulate/sum durations and token counts. However, Cortex doesn't know what the abctl user wants, or even if abctl is connected. If no one queries, it is wasted work.

  4. esnible commented on Sep 4, 2026

    @esnible
    MemberAuthor

    Candidate view of token usage

    ┌─ USAGE ─────────────────── default ── 10m ── ungrouped ── tokens ─────────────┐
    │                                                     peak 48.2k @ 23:31        │
    │  50k ┤                                                                        │
    │      │               ▃▃▃▃                                                     │
    │  40k ┤               ████                                                     │
    │      │               ████ ▆▆▆▆                                                │
    │  30k ┤          ▄▄▄▄ ████ ████                                                │
    │      │          ████ ████ ████ ▇▇▇▇                                           │
    │  20k ┤          ████ ████ ████ ████                                           │
    │      │     ▁▁▁▁ ████ ████ ████ ████ ▅▅▅▅                                      │
    │  10k ┤▇▇▇▇ ████ ████ ████ ████ ████ ████ ▆▆▆▆                                 │
    │      │████ ████ ████ ████ ████ ████ ████ ████ ▂▂▂▂                            │
    │    0 ┼────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴──                    │
    │      23:24  :26   :28   :30   :32   :34                                       │
    │                                                                               │
    │  4.1k  0    18.9k 31.2k 48.2k 38.7k 22.4k 29.8k 14.1k 16.3k 1.2k              │
    │                                     Σ 225.2k    ⌀ 20.5k/min                   │
    └───────────────────────────────────────────────────────────────────────────────┘
    
  5. esnible commented on Sep 4, 2026

    @esnible
    MemberAuthor

    Candidate view of grouping by STATUS

    Grouped by status — stacked, red on ≥400
    
    ┌─ USAGE ─────────────────── default ── 10m ── by status ── tokens ─────────────┐
    │                                                     peak 48.2k @ 23:31        │
    │  50k ┤                                                                        │
    │      │               ░░░░                                                     │
    │  40k ┤               ████                                                     │
    │      │               ████ ▒▒▒▒                                                │
    │  30k ┤          ░░░░ ████ ████                                                │
    │      │          ████ ████ ████ ░░░░                                           │
    │  20k ┤          ████ ████ ████ ████                                           │
    │      │     ▒▒▒▒ ████ ████ ████ ████ ░░░░                                      │
    │  10k ┤████ ████ ████ ████ ████ ████ ████ ▒▒▒▒                                 │
    │      │████ ████ ████ ████ ████ ████ ████ ████ ████                            │
    │    0 ┼────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴──                    │
    │      23:24  :26   :28   :30   :32   :34                                       │
    │                                                                               │
    │  4.1k  0    18.9k 31.2k 48.2k 38.7k 22.4k 29.8k 14.1k 16.3k 1.2k              │
    │                                                                               │
    │  █ 200 (198.4k)   ▒ 429 (24.6k)   ░ 500 (2.2k)        ← ▒ ░ render red        │
    └───────────────────────────────────────────────────────────────────────────────┘
    
  6. esnible commented on Sep 4, 2026

    @esnible
    MemberAuthor

    Candidate view of duration

    ┌─ LATENCY ───────────────── default ── 10m ── ungrouped ── p50 ⌀ σ ────────────┐
    │                                                     max 4.8s @ 23:31          │
    │   5s ┤                                                                        │
    │      │               ┬                                                        │
    │   4s ┤               │                                                        │
    │      │          ┬    │                                                        │
    │   3s ┤          │    ┼    ┬                                                   │
    │      │     ┬    ┼    │    │    ┬                                              │
    │   2s ┤     ┼    │    │    ┼    │    ┬    ┬                                    │
    │      │┬    │    ┴    │    │    ┼    ┼    │    ┬                               │
    │   1s ┤┼    ┴         ┴    ┴    │    │    ┼    ┼    ┬    ┬                     │
    │      │┴                        ┴    ┴    ┴    ┴    ┼    ┼                     │
    │    0 ┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼────┴─────┴──                 │
    │      23:24     :26      :28      :30      :32      :34                        │
    │                                                                               │
    │  ⌀ 1.84s   σ 0.62s   ┬ ⌀+σ  ┼ mean  ┴ ⌀−σ    (0 = no traffic)                 │
    └───────────────────────────────────────────────────────────────────────────────┘
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions