Skip to content

Commit

Permalink
fix: renterd average redundancy calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Dec 20, 2023
1 parent c990bc1 commit e24c893
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
22 changes: 22 additions & 0 deletions .changeset/metal-mugs-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'explorer': patch
'hostd': patch
'renterd': patch
'walletd': patch
'website': patch
'@siafoundation/data-sources': patch
'@siafoundation/design-system': patch
'@siafoundation/fonts': patch
'@siafoundation/next': patch
'@siafoundation/react-core': patch
'@siafoundation/react-hostd': patch
'@siafoundation/react-icons': patch
'@siafoundation/react-renterd': patch
'@siafoundation/react-sia-central': patch
'@siafoundation/react-walletd': patch
'@siafoundation/sia-central': patch
'@siafoundation/types': patch
'@siafoundation/units': patch
---

esm support
5 changes: 5 additions & 0 deletions .changeset/three-oranges-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'renterd': minor
---

The reported average redundancy factor now takes into account multipart uploads.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ export function FilesStatsMenuSize() {
return null
}

const averageRedundancyFactor = stats.data.totalObjectsSize
? stats.data.totalSectorsSize / stats.data.totalObjectsSize
const totalObjectsSize =
stats.data.totalObjectsSize + stats.data.totalUnfinishedObjectsSize
const averageRedundancyFactor = totalObjectsSize
? stats.data.totalSectorsSize / totalObjectsSize
: 0

return (
Expand Down
1 change: 0 additions & 1 deletion libs/design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"@radix-ui/react-switch": "^1.0.0",
"@radix-ui/react-tabs": "^1.0.0",
"@radix-ui/react-tooltip": "^1.0.0",
"clipboard-polyfill": "^3.0.3",
"react-hot-toast": "^2.2.0"
},
"devDependencies": {
Expand Down
6 changes: 2 additions & 4 deletions libs/react-renterd/src/bus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,6 @@ export function useContractsets(args?: HookArgsSwr<void, string[][]>) {
return useGetSwr({ ...args, route: '/bus/contracts/sets' })
}

export function useContractset(args: HookArgsSwr<{ name: string }, string[]>) {
return useGetSwr({ ...args, route: '/bus/contracts/sets/:set' })
}

export function useContractsetUpdate(
args: HookArgsCallback<{ name: string }, string[], never>
) {
Expand Down Expand Up @@ -614,8 +610,10 @@ export function useObjectDelete(

type ObjectsStats = {
numObjects: number // number of objects
numUnfinishedObjects: number // number of unfinished objects
minHealth: number // minimum health across all objects
totalObjectsSize: number // size of all objects
totalUnfinishedObjectsSize: number // size of all unfinished objects
totalSectorsSize: number // uploaded size of all objects
totalUploadedSize: number // uploaded size of all objects including redundant sectors
}
Expand Down

0 comments on commit e24c893

Please sign in to comment.