@cryptotaxi247 / kubo / commits / d1f654148

fix: increase provider sample size (#10589)

Marcin Rataj committed Nov 25, 2024 at 18:03 UTC d1f654148f98772352f9faa21dbc7fb85614ee84
1 file changed +6 -2
core/node/provider.go
+6 -2
@@ -14,8 +14,12 @@ import (
14 "go.uber.org/fx"
15 )
16
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 +
22 func ProviderSys(reprovideInterval time.Duration, acceleratedDHTClient bool) fx.Option {
18 - const magicThroughputReportCount = 128
23 return fx.Provide(func(lc fx.Lifecycle, cr irouting.ProvideManyRouter, keyProvider provider.KeyChanFunc, repo repo.Repo, bs blockstore.Blockstore) (provider.System, error) {
24 opts := []provider.Option{
25 provider.Online(cr),
@@ -105,7 +109,7 @@ https://github.com/ipfs/kubo/blob/master/docs/config.md#routingaccelerateddhtcli
109 keysProvided, avgProvideSpeed, count, avgProvideSpeed*time.Duration(count), reprovideInterval)
110 }
111 return false
108 - }, magicThroughputReportCount))
112 + }, sampledBatchSize))
113 }
114 sys, err := provider.New(repo.Datastore(), opts...)
115 if err != nil {