MCPcopy Create free account
hub / github.com/ceph/ceph / generate_random

Method generate_random

src/test/objectstore/ObjectStoreTransactionBenchmark.cc:177–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175
176
177 bufferlist generate_random(uint64_t len, int frag) {
178 static const char alphanum[] = "0123456789"
179 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
180 "abcdefghijklmnopqrstuvwxyz";
181 uint64_t per_frag = len / frag;
182 bufferlist bl;
183 for (int i = 0; i < frag; i++ ) {
184 bufferptr bp(per_frag);
185 for (unsigned int j = 0; j < len; j++) {
186 bp[j] = alphanum[rand() % (sizeof(alphanum) - 1)];
187 }
188 bl.append(bp);
189 }
190 return bl;
191 }
192 public:
193 PerfCase() {
194 uint64_t four_kb = Kib * 4;

Callers 15

do_mapFunction · 0.45
random_keyFunction · 0.45
TEST_PFunction · 0.45
send_messageMethod · 0.45
send_large_messageMethod · 0.45
TestImageReplayerMethod · 0.45
TEST_FFunction · 0.45
setup_osdmapMethod · 0.45
setup_mapMethod · 0.45
set_up_mapMethod · 0.45

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected