description: "Whole-log conversation counts and wall times for clients and maintainers choosing, composing, or debugging the sessionStats projection unit."
English | 中文
dsh-session-stats serves whole-log conversation figures — turn and step counts plus LLM, tool, first-token, and decode wall times — as the sessionStats projection unit. Clients read the figures from the registry's snapshot and change feed, and paging or compaction cannot change them because they fold from the complete durable log. Choose it in compositions that already mount the projection registry, such as the web chat bundle whose stats strip is the reference consumer; assemblies without the registry are unaffected and their consumers fall back to window-scoped counting. Setup and field semantics come first; the fold internals live in a collapsible developer section below.
Mount the plugin beside the session store and the projection registry when clients should display whole-session conversation figures that survive paging and compaction. The unit registers only when the registry is present.
- name: '@deepseek-ai/dsh-session'
- name: '@deepseek-ai/dsh-session-projection'
- name: '@deepseek-ai/dsh-session-stats'
| Field | Meaning |
|---|---|
turns |
Distinct turns with at least one closed step; rejected or empty turns are uncounted |
steps |
Closed steps — completed, failed, cancelled, and max-tokens steps all count |
llmMs |
Summed model wall time over steps that assembled a message |
toolMs |
Summed matched tool/call → tool/result wall time |
ttftMs / ttftSteps |
Summed first-token latency and the steps carrying it |
decodeMs / decodeTokens |
Summed decode wall time and provider output tokens over usage-reporting steps |
Every field is 0 until its first contributing event; the composed registry always serves the key, so clients read the value rather than key presence. Clients render whole-log figures through the projection seam's snapshot and change feed; the reference consumer is the web chat stats strip, whose window fold mirrors these field names as its no-unit fallback.
The unit is inert without the projection registry: inject keeps the fiber pending and nothing registers, so other assemblies lack the sessionStats key. Unmounting the plugin removes the key, because registrations are effects on the mounting fiber. A crash-interrupted step counts after the session reloads, when crash recovery appends its synthetic step/end.
Read these pages when the unit's contract is not enough. They move from the registry that drives units to adjacent session packages.
None, as the sessionStats unit folds already-logged step boundaries into a client-facing read model and registers nothing model-facing.
None; the package never assembles or sends provider requests.
These limits define what the figures describe and when the unit is absent. They are current package constraints.
step/end and counts; a step interrupted by a crash counts after the session reloads, when crash recovery appends its synthetic step/end.sessionStats key, and their consumers fall back to window-scoped counting.