Introduction¶
In daily usage of DeepSeek Harness (DSH), tracking token consumption and first-byte latency is crucial for cost control and performance optimization. DSH itself does not provide a fine-grained statistics panel to intuitively view consumption broken down by workspace or session. The dsh-usage-stats plugin described below reads local session logs directly to provide this data.
Plugin Overview¶
dsh-usage-stats is a plugin that tracks daily token consumption and average first-byte latency, broken down by workspace and session. This plugin is maintained by iuuuuuuuu and is released under the MIT License.
Core Features¶
- Daily Statistics: Tracks daily token consumption and average first-byte latency, with breakdowns for uncached input, cache reads, and output.
- Three-level Drill-down: Supports drilling down through three levels of detail: Overview → Workspace → Session.
- Time Filtering: Supports time filtering, including Today, Last 7 Days, Last 30 Days, and Custom Ranges.
- Interactive Sorting: Supports sorting by any metric column.
- Default Window: Retains a default statistics window of 30 days.
- Access Points: Displays “Usage Statistics” in Settings, and adds a toggleable bar chart icon to the sidebar.
- Data Source: Read-only access to local session logs; it does not modify or delete any existing files.
Installation and Activation¶
Install the plugin using the following command:
dsh plugin --profile <profile> add "git+https://github.com/iuuuuuuuu/dsh-usage-stats.git"
After installation, refresh the page. You will see the statistics in “Settings → Usage Statistics,” and a bar chart icon will appear in the sidebar.
Typical Usage¶
Navigate to the “Settings → Usage Statistics” panel, which displays today’s data by default. Users can open an independent full-width panel via the sidebar icon, use the time filter to view data for specific intervals, and click on column headers to sort by metrics such as “Uncached Input,” “Cache Reads,” or “Average First-Byte Latency.”
Use Cases and Notes¶
This plugin is suitable for users who require granular cost monitoring or need to analyze first-byte latency performance.
You should review the source code and license before installing. Since the plugin runs with the permissions of the current DSH process, please note the following limitations:
- zstd Format Only: Only supports session logs in zstd format; deployments with
compression: 'none'are not supported. - Fixed Window: The statistics window is fixed at 30 days and is currently not configurable.
- Read-Only Access: The plugin only reads session logs; it does not modify or delete any existing files.
Conclusion¶
dsh-usage-stats provides a purely local, read-only usage statistics solution. With it, developers can gain a clearer understanding of the cost structure and performance metrics of model invocations.