When debugging or optimizing sessions, developers need an intuitive view of Token consumption, Wall time, and cache hit rate. Existing views may lack fine-grained statistics by model or by turn. This plugin adds a Usage tab to the session interface, providing detailed data views by model and by turn.

Plugin Introduction

This is a client-side plugin for viewing Token, Wall time, and cache hit rate in a session. It does not modify the DeepSeek Harness source code; it only reads and displays data. It is maintained by ewoowe.

Core Features

  1. New Usage tab in the session: Displays session totals in the session interface.
  2. Two table views:
    • Model usage (default): Shows Token, Wall time, and Cache hit details by model.
    • Message usage: Shows Token, Wall time, and Cache hit details by turn.
  3. Sorting and filtering:
    • The Message usage table supports clicking table headers to sort by any column.
    • Supports multiple time-range filters: Session, Today, 24h, Yesterday, 3d, 7d, Custom.
  4. History loading:
    • Shows turn coverage within the loaded window (e.g., Folded 12 of 22 turns).
    • Provides a Load the older turns button to load history.
  5. Data calculation:
    • Uses ISession.projections to calculate overall statistics.
    • Depends on @deepseek-ai/cordis, react, react-dom, and other dependencies.

Typical Usage

  1. Switch between Model usage and Message usage table views in the session.
  2. Click any column header in Message usage to sort the table.
  3. Select a time range such as Today or 7 days to view statistics for a specific period.
  4. Click Load the older turns to load history and view folded turns.
  5. View cache hit percentages with decimal places (e.g., 99.95).

Use Cases and Notes

  • Use case: Suitable for developers who need to analyze session cost and performance in detail.
  • Concept clarification: Each row in the table represents a turn (a Prompt and its corresponding Assistant response), not a single message. An Assistant response belongs to the same turn as the Prompt that initiated it.
  • Time range: The Today range only counts time spent within the session, not the current system date.
  • Cache hit rate: Percentage values are not capped and retain decimals (e.g., 99.95).
  • Dependencies: Requires libraries such as @deepseek-ai/cordis, react, react-dom.
  • License: MIT.
  • Source code safety: The plugin only reads and displays data; it does not modify the packages/ directory.

Summary

The plugin calculates data using ISession.projections and event windows, providing visualization support for session analysis. For more details, visit the SkillHub directory or GitHub.