dsh-usage-statistics: DeepSeek Harness Usage Statistics Plugin

Introduction

When performing model inference with DeepSeek Harness (DSH), developers often need a clear, at-a-glance view of token consumption, cache hit rates, and real-time request activity. The community-maintained xq25478/dsh-usage-statistics plugin provides a usage statistics page in the left sidebar, aggregating daily/hourly token usage, cache hit rates, and real-time request logs—so you don’t have to piece together metrics from raw logs or dashboards.

What It Is

dsh-usage-statistics is a DeepSeek Harness community plugin that adds a usage statistics page to DSH. It reads local session logs (~/.dsh/sessions), aggregates token counts, cache hits, and request volumes by day/hour, and presents the results via charts and a real-time list. The plugin is a pure JavaScript profile bundle—no build steps or extra dependencies required, and no network calls are made.

Core Features

  • Time-range toolbar: Defaults to today; supports the last 7 days, the last 30 days, or a custom date range.
  • Three key metric groups: Total tokens for the current range (new input, cache read/write, output), request count with average tokens per request, and cache hit rate.
  • Vertical bar chart: Plotted by day or by hour, with cache hits in green, misses in gray, and output in orange. Hover for 1 second to reveal exact values.
  • Real-time request log: Displays session directory, provider, model, new input tokens, cache read tokens, output tokens, speed (tokens/sec), and time-to-first-token in reverse chronological order. Token counts are shown in “ten-thousands / billions” format; hover to see precise values. New arriving rows are highlighted with a flashing border.
  • Sticky bottom bar: Shows today’s real-time metrics, independent of the range selected above.

Installation & Activation

  1. Clone the plugin directory into your DSH plugins folder:
git clone https://github.com/xq25478/dsh-usage-statistics.git ~/dsh-plugins/dsh-usage-statistics
  1. In DSH, open “Plugins → Add plugin” and select that directory; or run the command directly:
plugin_manager install_bundle target=~/dsh-plugins/dsh-usage-statistics
  1. A chart icon will appear below the session list in the left sidebar. Click it to open the usage statistics page. This plugin requires DeepSeek Harness 0.2.2-rc.3 or later.

Typical Usage

  • Open the usage statistics page to view today’s data by default; switch the time range to see the last 7/30 days or a custom interval.
  • Inspect cache hit rate and cache read/write tokens to evaluate your caching strategy’s effectiveness.
  • Use the real-time log to monitor recent requests’ token distribution, speed, and time-to-first-token to diagnose slow requests or anomalous traffic.
  • In long-running sessions, the sticky bottom bar provides today’s live metrics for quick cross-checking.

Use Cases & Caveats

Ideal for developers and teams that need to continuously track model inference costs, optimize caching strategies, and monitor request quality.

Note: The plugin runs with the current DSH process’s permissions and reads local session logs (~/.dsh/sessions). It is recommended to review the source code and license (MIT) before installing. If sessions are written by another DSH process, you must restart the current process to sync.

Conclusion

dsh-usage-statistics delivers a centralized view spanning token usage, cache hit rates, and real-time request logs—well suited to agent development scenarios that demand fine-grained cost and performance insight.

  • Directory page: https://www.skillhub.cn/plugins/xq25478/dsh-usage-statistics
  • GitHub: https://github.com/xq25478/dsh-usage-statistics
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye