MCPcopy
hub / github.com/syncthing/syncthing / genFiles

Function genFiles

lib/model/model_test.go:141–155  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

139}
140
141func genFiles(n int) []protocol.FileInfo {
142 files := make([]protocol.FileInfo, n)
143 t := time.Now().Unix()
144 for i := 0; i < n; i++ {
145 files[i] = protocol.FileInfo{
146 Name: fmt.Sprintf("file%d", i),
147 ModifiedS: t,
148 Sequence: int64(i + 1),
149 Blocks: []protocol.BlockInfo{{Offset: 0, Size: 100, Hash: []byte("some hash bytes")}},
150 Version: protocol.Vector{Counters: []protocol.Counter{{ID: 42, Value: 1}}},
151 }
152 }
153
154 return files
155}
156
157func BenchmarkIndex_10000(b *testing.B) {
158 benchmarkIndex(b, 10000)

Callers 7

benchmarkIndexFunction · 0.85
benchmarkIndexUpdateFunction · 0.85
BenchmarkRequestOutFunction · 0.85
BenchmarkJobQueueBumpFunction · 0.85

Calls 1

NowMethod · 0.65

Tested by

no test coverage detected