Skip to content

Commit 51c4840

Browse files
committed
feat(indexd): expand account stats fields
1 parent 74106e9 commit 51c4840

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@siafoundation/indexd-types': minor
3+
---
4+
5+
Expanded account stats response with active, pinnedData, and pinnedSize fields.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'indexd': minor
3+
---
4+
5+
Expanded account stats metrics with active accounts, pinned data, and pinned size.

apps/indexd/components/Metrics/MetricsAccounts.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Skeleton,
77
} from '@siafoundation/design-system'
88
import { useAdminStatsAccounts } from '@siafoundation/indexd-react'
9+
import { humanBytes } from '@siafoundation/units'
910
import { InfoRow } from '../Data/PanelInfoRow'
1011

1112
export function MetricsAccounts() {
@@ -30,6 +31,18 @@ export function MetricsAccounts() {
3031
label="Registered Accounts"
3132
value={<Skeleton className="h-12 w-[150px]" />}
3233
/>
34+
<InfoRow
35+
label="Active Accounts"
36+
value={<Skeleton className="h-12 w-[150px]" />}
37+
/>
38+
<InfoRow
39+
label="Pinned Data"
40+
value={<Skeleton className="h-12 w-[150px]" />}
41+
/>
42+
<InfoRow
43+
label="Pinned Size"
44+
value={<Skeleton className="h-12 w-[150px]" />}
45+
/>
3346
</div>
3447
}
3548
notFound={<StateNoneYet message="No metrics found." />}
@@ -39,6 +52,18 @@ export function MetricsAccounts() {
3952
label="Registered Accounts"
4053
value={stats.registered.toLocaleString()}
4154
/>
55+
<InfoRow
56+
label="Active Accounts"
57+
value={stats.active.toLocaleString()}
58+
/>
59+
<InfoRow
60+
label="Pinned Data"
61+
value={humanBytes(stats.pinnedData)}
62+
/>
63+
<InfoRow
64+
label="Pinned Size"
65+
value={humanBytes(stats.pinnedSize)}
66+
/>
4267
</div>
4368
)}
4469
/>

libs/indexd-types/src/admin/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,9 @@ export type AdminStatsAccountsParams = void
383383
export type AdminStatsAccountsPayload = void
384384
export type AdminStatsAccountsResponse = {
385385
registered: number
386+
active: number
387+
pinnedData: number
388+
pinnedSize: number
386389
}
387390

388391
export const adminStatsContractsRoute = '/stats/contracts'

0 commit comments

Comments
 (0)