Community plugin

douglarek / @douglarek/dsh-statistics

Token usage, cost, budget, and CPU activity panel for DeepSeek Harness

  • JavaScript
  • License not detected
  • 2 stars
  • Nov 23, 2026

About this plugin

Written by the registry from verified metadata, not from the README.

@douglarek/dsh-statistics is a DSH plugin published from the douglarek/dsh-statistics repository.

  • Listing statusManifest verified
  • Manifest checkedNov 20, 2026
  • Package@douglarek/dsh-statistics
  • Package version1.4.1
  • Source commit239964e
  • Repository createdNov 4, 2026

Capabilities and topics

budget-trackingcordis-plugincost-trackingdeepseek-harness
From the repository README

README

Everything below this line is the repository's own document, cached here. This site did not write or review it.

Cached versionView on GitHub

dsh-statistics

A DeepSeek Harness bundle that reads every conversation log in the current profile and reports what those conversations actually cost. It adds a Statistics panel to the sidebar, beside Plugins and Schedules.

The panelSessions
The Statistics panel: token totals, budget, a daily usage timeline with cost and request lines, CPU activity, and model costsSessions as cards: each with a cost-split donut, turns, tokens, cost, CPU, and the model it ran on

Plugin index

This plugin is listed in dsh-plugin-index.

Index URL:

https://raw.githubusercontent.com/douglarek/dsh-plugin-index/main/index.json

When the package version changes, add the new version and its release commit to the index; otherwise Discover keeps showing the previous version.

What the panel shows

  • Total tokens with the input / output / cache-read split, conversation count, turns, steps, and tool calls.
  • Estimated cost, priced per conversation and per day from a configurable rate card, plus a budget card with the spend of the current period, a progress bar, and a projection to the end of the period.
  • Token usage timeline — one stacked column per day, switchable between all tokens and input + output only, with a selectable day detail line.
  • Models — token volume and cost per provider/model, four rows in view and the rest scrolling, flagging models that fell back to the catch-all rate.
  • Conversations — sortable cards for every conversation with its tokens, estimated cost, and attributed CPU time, newest activity first by default, four rows in view and the rest scrolling.
  • CPU activity — the host process utilization history (last few minutes), system utilization, load average, core count, and memory for the whole app (renderer and helpers included) with the panel process's own share beside it, next to live per-conversation CPU attribution.

Ranges: last 7, last 30, last 90 days, or everything (the default). The header reports the data source and the number of logs scanned.

Where the numbers come from

Token usage is folded from committed assistant/message and compaction/summary events of every stored conversation, read through sessionQuery (live-preferred) or sessionPersistence. Nothing is sampled or estimated on the token side: the counts are the provider's own usage records, attributed to the model named on each message.

Cost is an estimate: tokens are multiplied by the rate card below. The budget card compares that estimate with budgetUsd for the selected period.

A conversation's last active time is the last turn, step, message, tool call, or compaction event — bookkeeping events (session/end-seed, permission/preset, sandbox/mode, workspace/changes) are written whenever a Session is opened again and must not move that date.

CPU is measured in this process: process.cpuUsage() deltas and os.cpus() idle deltas sampled every cpuIntervalMs. Each interval's CPU time is split across the conversations that were running or that produced an event within the last 10 seconds; time with nothing active is reported as idle. Attribution starts when the plugin loads, so the per-conversation CPU column shows — for conversations it never saw running.

Configuration

Set these on the statistics row of the bundle patch (~/.dsh/profiles/desktop/cordis.patch.yml) to override the defaults.

KeyDefaultMeaning
ratessee cordis.patch.ymlRate rules matched against provider/model and model, * wildcards allowed. Values are USD per 1,000,000 tokens.
fallbackRate0.27 / 1.10 / 0.07Applied to models no rule matches.
budgetUsd20Budget for the current period.
budgetPeriodmonthday, week, month, or all.
cpuIntervalMs2000CPU sampling interval.
cpuHistorySize120Samples retained for the sparkline.
refreshMs4000Panel polling interval.
statsTtlMs15000Minimum age before the log scan is repeated.
includeSubagentstrueCount subagent conversations.
maxSessions500Upper bound on logs read per scan.

HTTP surface

One route, inside Connection's authentication fence:

GET /api/statistics/snapshot

It returns the whole panel payload — totals, budget, day series, models slot, conversation rows with per-day buckets, and the CPU sample window — so the browser never folds session events itself.

Files

FileRole
index.jsHost route, session source, scan cache, CPU sampler wiring.
lib/fold.jsPure event folding, pricing, and aggregation.
lib/cpu.jsCPU sampler with injectable probes.
client.jsSidebar icon and panel, plain JavaScript for the module loader.
cordis.patch.ymlInserts the statistics row with the default config.
locale/{en,zh}.jsonDisplay metadata read by Plugin Manager.

Badge

Listed here? Link back with this badge — paste the snippet into your repository README.

Listed on DSH Plugin badge
[![Listed on DSH Plugin](https://dsh-plugin.com/badges/listed.svg)](https://dsh-plugin.com/plugins/douglarek/dsh-statistics)