bzhao0110/dsh-usage-dashboard ↗★ 0
dsh-usage-dashboard
Token usage statistics dashboard (zcode-style) for DeepSeek Harness: stat cards, activity heatmap, daily trend and model share 适合需要直观分析历史Token消耗、模型占比和使用趋势的用户。
Other repositories with this package name
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:bzhao0110/dsh-usage-dashboardREADME
Read the full README ↗dsh-usage-dashboard
DeepSeek Harness 的 Token 用量统计插件 —— 在 设置 → Token 统计 中提供 zcode 风格的用量面板:
- 5 张指标卡:累计 Token、单日峰值、最长会话时长、当前/最长连续使用天数
- Token 活动热力图:53 周 GitHub 风格(每日 / 累计切换)
- 每日 Token 趋势:近 7 日 / 近 30 日,按模型分系列折线
- 模型用量环形图:占比 + 明细列表
原理
- 零运行时依赖,图表全部手写 SVG。
- 服务端注册
tokenStats会话投影(ctx.sessionProjections.register), 折叠request/header/step/start/assistant usage/step/end/compaction/summary事件,按 天 × 模型 累计 token。Harness 会在会话 首次被触碰时回放持久化日志,因此历史会话同样被统计。 - 客户端通过
settings.section槽位注入设置页,聚合全部会话的projectionValues.tokenStats渲染面板。
安装
npm(推荐)
dsh plugin --profile web add dsh-usage-dashboard
# 桌面版:设置 → 插件 → Add plugin → npm 包名填 dsh-usage-dashboard
从源码 / 本地开发
# dependencies 增加 "dsh-usage-dashboard": "file:/path/to/dsh-usage-dashboard"
# dsh.profile.bundles 增加 "dsh-usage-dashboard"