feat(stats): show model unique users
This commit is contained in:
parent
49593c1ec4
commit
7d204b5b57
@ -330,7 +330,7 @@ function CatalogDatum(props: { label: string; value: string }) {
|
||||
function ModelOverview(props: { data: StatsModelData | null }) {
|
||||
return (
|
||||
<section data-section="model-panel">
|
||||
<SectionTitle title="Overview" description="Recent OpenCode Go tokens, sessions, and market position." />
|
||||
<SectionTitle title="Overview" description="Recent OpenCode Go tokens, unique users, and market position." />
|
||||
<Show
|
||||
when={props.data}
|
||||
fallback={
|
||||
@ -340,6 +340,11 @@ function ModelOverview(props: { data: StatsModelData | null }) {
|
||||
{(data) => (
|
||||
<div data-component="model-metric-grid">
|
||||
<MetricCard label="Tokens" value={formatTokens(data().totals.tokens)} detail="last two months" />
|
||||
<MetricCard
|
||||
label="Unique Users"
|
||||
value={formatUsers(data().totals.uniqueUsers)}
|
||||
detail="last two months"
|
||||
/>
|
||||
<MetricCard label="Sessions" value={formatInteger(data().totals.sessions)} detail="completed sessions" />
|
||||
<MetricCard
|
||||
label="Token Share"
|
||||
|
||||
@ -54,6 +54,7 @@ export type StatsModelData = {
|
||||
tokenChange: number
|
||||
totals: {
|
||||
sessions: number
|
||||
uniqueUsers: number
|
||||
tokens: number
|
||||
cost: number
|
||||
tokensPerSession: number
|
||||
@ -381,6 +382,7 @@ function buildStatsModelData(
|
||||
tokenChange: percentChange(current.totalTokens, previous.totalTokens),
|
||||
totals: {
|
||||
sessions: current.sessions,
|
||||
uniqueUsers: current.uniqueUsers,
|
||||
tokens: current.totalTokens,
|
||||
cost: round(microcentsToDollars(current.totalCostMicrocents), 2),
|
||||
tokensPerSession: current.sessions > 0 ? Math.round(current.totalTokens / current.sessions) : 0,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user