dsh-usage-meter: A Token Usage Statistics Plugin for DSH Web Client

Preface

In DSH’s plugin-based usage model, many client capabilities can be integrated as plugins. For DSH clients on the Web platform, a common requirement is to gain clearer visibility into token usage from model calls: which model, which hour, and how much each accounts for.

dsh-usage-meter is a usage statistics plugin maintained by cute-baobao, designed for DSH clients on the Web platform. It automatically records token usage from model calls, aggregates it by “model × hour,” and displays it as a stacked bar chart in the Web GUI settings page.

What This Is

dsh-usage-meter is a usage statistics plugin for DeepSeek Harness. It records token usage to a local file and re-aggregates it on startup, providing a “model × hour” bar chart for the settings page.

It targets Web platform clients, where dsh.client.platform is web, and injects the following client packages:

@deepseek-ai/dsh-client-locale
@deepseek-ai/dsh-client-runtime
@deepseek-ai/dsh-client-ui-settings

The license is MIT.

Core Features

  • Automatically records token usage from model calls.
  • Aggregates usage data by “model × hour.”
  • Displays it as a stacked bar chart in the Web GUI settings page: one bar per hour, color-coded by model.
  • Data is recorded in a local JSONL file.
  • Re-aggregates by hour on startup.
  • Interface supports both Chinese and English, following the GUI language.

The data file location is:

$DSH_HOME/usage-meter/usage.jsonl

Installation and Activation

First, install the plugin. The following command uses pnpm and the web profile:

pnpm dsh plugin --profile web add @dsh-usage-meter/usage

If resolution fails on the release day itself, you can explicitly pin a version, such as 0.3.0:

pnpm dsh plugin --profile web add @dsh-usage-meter/usage@0.3.0

After installation, restart the Web client:

dsh web

Once the restart is complete, navigate to “Settings → Usage Statistics” to view it.

Typical Usage

Below is a minimal verification sequence:

  1. Install the plugin:
pnpm dsh plugin --profile web add @dsh-usage-meter/usage
  1. Restart the DSH Web process:
dsh web
  1. Open “Settings → Usage Statistics” to view the stacked bar chart by hour and model.

  2. To inspect raw records, check the data file:

$DSH_HOME/usage-meter/usage.jsonl
  1. If no longer needed, you can uninstall:
pnpm dsh plugin --profile web remove @dsh-usage-meter/usage

Applicable Scenarios and Notes

Suitable for those who need to view token usage of DSH clients on the Web platform, especially those who want to observe call patterns by model and hour and see charts in the settings page.

Notes before use:

  • The plugin runs with the current dsh process permissions; it is recommended to review the source code and license before installation.
  • The license is MIT.
  • The Node requirement and package manager version declared in package.json are:
node: ^22.19.0 || >=24.0.0
pnpm@11.7.0
  • Data is recorded in:
$DSH_HOME/usage-meter/usage.jsonl

Re-aggregated by hour on startup.

  • The interface language follows the GUI, supporting both Chinese and English.

Links

GitHub repository:

https://github.com/cute-baobao/dsh-usage-meter
羽毛球分组比赛记分
小程序二维码

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

Xiaoye