@@ -114,7 +114,7 @@ func BenchmarkFixedDelay(b *testing.B) {
114
114
}
115
115
116
116
out , _ := json .MarshalIndent (benchmarkLog , "" , " " )
117
- _ = os .WriteFile ("tmp/benchmark.json" , out , 0666 )
117
+ _ = os .WriteFile ("tmp/benchmark.json" , out , 0o666 )
118
118
printResults (benchmarkLog )
119
119
}
120
120
@@ -182,28 +182,30 @@ func BenchmarkFetchFromOldBitswap(b *testing.B) {
182
182
}
183
183
184
184
out , _ := json .MarshalIndent (benchmarkLog , "" , " " )
185
- _ = os .WriteFile ("tmp/benchmark.json" , out , 0666 )
185
+ _ = os .WriteFile ("tmp/benchmark.json" , out , 0o666 )
186
186
printResults (benchmarkLog )
187
187
}
188
188
189
- const datacenterSpeed = 5 * time .Millisecond
190
- const fastSpeed = 60 * time .Millisecond
191
- const mediumSpeed = 200 * time .Millisecond
192
- const slowSpeed = 800 * time .Millisecond
193
- const superSlowSpeed = 4000 * time .Millisecond
194
- const datacenterDistribution = 3 * time .Millisecond
195
- const distribution = 20 * time .Millisecond
196
- const datacenterBandwidth = 125000000.0
197
- const datacenterBandwidthDeviation = 3000000.0
198
- const fastBandwidth = 1250000.0
199
- const fastBandwidthDeviation = 300000.0
200
- const mediumBandwidth = 500000.0
201
- const mediumBandwidthDeviation = 80000.0
202
- const slowBandwidth = 100000.0
203
- const slowBandwidthDeviation = 16500.0
204
- const rootBlockSize = 800
205
- const stdBlockSize = 8000
206
- const largeBlockSize = int64 (256 * 1024 )
189
+ const (
190
+ datacenterSpeed = 5 * time .Millisecond
191
+ fastSpeed = 60 * time .Millisecond
192
+ mediumSpeed = 200 * time .Millisecond
193
+ slowSpeed = 800 * time .Millisecond
194
+ superSlowSpeed = 4000 * time .Millisecond
195
+ datacenterDistribution = 3 * time .Millisecond
196
+ distribution = 20 * time .Millisecond
197
+ datacenterBandwidth = 125000000.0
198
+ datacenterBandwidthDeviation = 3000000.0
199
+ fastBandwidth = 1250000.0
200
+ fastBandwidthDeviation = 300000.0
201
+ mediumBandwidth = 500000.0
202
+ mediumBandwidthDeviation = 80000.0
203
+ slowBandwidth = 100000.0
204
+ slowBandwidthDeviation = 16500.0
205
+ rootBlockSize = 800
206
+ stdBlockSize = 8000
207
+ largeBlockSize = int64 (256 * 1024 )
208
+ )
207
209
208
210
func BenchmarkRealWorld (b * testing.B ) {
209
211
benchmarkLog = nil
@@ -240,7 +242,7 @@ func BenchmarkRealWorld(b *testing.B) {
240
242
subtestDistributeAndFetchRateLimited (b , 300 , 200 , slowNetworkDelay , slowBandwidthGenerator , stdBlockSize , bstoreLatency , allToAll , batchFetchAll )
241
243
})
242
244
out , _ := json .MarshalIndent (benchmarkLog , "" , " " )
243
- _ = os .WriteFile ("tmp/rw-benchmark.json" , out , 0666 )
245
+ _ = os .WriteFile ("tmp/rw-benchmark.json" , out , 0o666 )
244
246
printResults (benchmarkLog )
245
247
}
246
248
@@ -263,7 +265,7 @@ func BenchmarkDatacenter(b *testing.B) {
263
265
subtestDistributeAndFetchRateLimited (b , 3 , 100 , datacenterNetworkDelay , datacenterBandwidthGenerator , largeBlockSize , bstoreLatency , allToAll , unixfsFileFetch )
264
266
})
265
267
out , _ := json .MarshalIndent (benchmarkLog , "" , " " )
266
- _ = os .WriteFile ("tmp/rb-benchmark.json" , out , 0666 )
268
+ _ = os .WriteFile ("tmp/rb-benchmark.json" , out , 0o666 )
267
269
printResults (benchmarkLog )
268
270
}
269
271
@@ -304,7 +306,7 @@ func BenchmarkDatacenterMultiLeechMultiSeed(b *testing.B) {
304
306
})
305
307
306
308
out , _ := json .MarshalIndent (benchmarkLog , "" , " " )
307
- _ = os .WriteFile ("tmp/rb-benchmark.json" , out , 0666 )
309
+ _ = os .WriteFile ("tmp/rb-benchmark.json" , out , 0o666 )
308
310
printResults (benchmarkLog )
309
311
}
310
312
0 commit comments