diff --git a/.changeset/spicy-boats-sneeze.md b/.changeset/spicy-boats-sneeze.md new file mode 100644 index 000000000..d9ecbbbfe --- /dev/null +++ b/.changeset/spicy-boats-sneeze.md @@ -0,0 +1,7 @@ +--- +'@siafoundation/hostd-types': minor +'@siafoundation/hostd-js': minor +'@siafoundation/hostd-react': minor +--- + +The metrics API types now include all available fields. diff --git a/.changeset/sweet-meals-flash.md b/.changeset/sweet-meals-flash.md new file mode 100644 index 000000000..01526f793 --- /dev/null +++ b/.changeset/sweet-meals-flash.md @@ -0,0 +1,7 @@ +--- +'@siafoundation/hostd-types': minor +'@siafoundation/hostd-js': minor +'@siafoundation/hostd-react': minor +--- + +The metrics APIs now include wallet with balance and immatureBalance. diff --git a/apps/hostd/contexts/transactions/index.tsx b/apps/hostd/contexts/transactions/index.tsx index be19acc83..a1acee10d 100644 --- a/apps/hostd/contexts/transactions/index.tsx +++ b/apps/hostd/contexts/transactions/index.tsx @@ -160,7 +160,7 @@ function useTransactionsMain() { (metrics.data || []) .map((t) => { return { - sc: Number(t.balance), + sc: Number(t.wallet.balance), timestamp: new Date(t.timestamp).getTime(), } }) diff --git a/internal/cluster/bin/clusterd b/internal/cluster/bin/clusterd new file mode 100755 index 000000000..6091a266c Binary files /dev/null and b/internal/cluster/bin/clusterd differ diff --git a/libs/hostd-types/src/api.ts b/libs/hostd-types/src/api.ts index 7917d4ec3..23b4e3a4b 100644 --- a/libs/hostd-types/src/api.ts +++ b/libs/hostd-types/src/api.ts @@ -231,27 +231,26 @@ type Revenue = { registryWrite: string } -// Data is a collection of metrics related to data usage. -type Data = { +type DataRHPMetrics = { // Ingress returns the number of bytes received by the host. ingress: number // Egress returns the number of bytes sent by the host. egress: number } -// Contracts is a collection of metrics related to contracts. -type Contracts = { - pending: number +type ContractMetrics = { active: number rejected: number failed: number + renewed: number + finalized: number successful: number + pending: number // TODO: remove? lockedCollateral: string riskedCollateral: string } -// Pricing is a collection of metrics related to the host's pricing settings. -type Pricing = { +type PricingMetrics = { contractPrice: string ingressPrice: string egressPrice: string @@ -261,8 +260,7 @@ type Pricing = { collateralMultiplier: number } -// Registry is a collection of metrics related to the host's registry. -type Registry = { +type RegistryMetrics = { entries: number maxEntries: number @@ -270,35 +268,46 @@ type Registry = { writes: number } -// Storage is a collection of metrics related to storage. -type Storage = { +type StorageMetrics = { totalSectors: number physicalSectors: number + lostSectors: number contractSectors: number tempSectors: number reads: number writes: number + sectorCacheHits: number + sectorCacheMisses: number } -// RevenueMetrics is a collection of metrics related to revenue. type RevenueMetrics = { potential: Revenue earned: Revenue } -// DataMetrics is a collection of metrics related to data usage. type DataMetrics = { - rhp: Data + rhp: DataRHPMetrics +} + +type AccountMetrics = { + active: number + balance: string +} + +type WalletMetrics = { + balance: string + immatureBalance: string } export type Metrics = { + accounts: AccountMetrics revenue: RevenueMetrics - pricing: Pricing - contracts: Contracts - storage: Storage - registry: Registry + pricing: PricingMetrics + contracts: ContractMetrics + storage: StorageMetrics + registry: RegistryMetrics data: DataMetrics - balance: string + wallet: WalletMetrics timestamp: string }