Skip to content

Commit d1f6541

Browse files
authored
fix: increase provider sample size (#10589)
1 parent d506003 commit d1f6541

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/node/provider.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ import (
1414
"go.uber.org/fx"
1515
)
1616

17+
// The size of a batch that will be used for calculating average announcement
18+
// time per CID, inside of boxo/provider.ThroughputReport
19+
// and in 'ipfs stats provide' report.
20+
const sampledBatchSize = 1000
21+
1722
func ProviderSys(reprovideInterval time.Duration, acceleratedDHTClient bool) fx.Option {
18-
const magicThroughputReportCount = 128
1923
return fx.Provide(func(lc fx.Lifecycle, cr irouting.ProvideManyRouter, keyProvider provider.KeyChanFunc, repo repo.Repo, bs blockstore.Blockstore) (provider.System, error) {
2024
opts := []provider.Option{
2125
provider.Online(cr),
@@ -105,7 +109,7 @@ https://github.com/ipfs/kubo/blob/master/docs/config.md#routingaccelerateddhtcli
105109
keysProvided, avgProvideSpeed, count, avgProvideSpeed*time.Duration(count), reprovideInterval)
106110
}
107111
return false
108-
}, magicThroughputReportCount))
112+
}, sampledBatchSize))
109113
}
110114
sys, err := provider.New(repo.Datastore(), opts...)
111115
if err != nil {

0 commit comments

Comments
 (0)