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

Method encode

src/test/erasure-code/ceph_erasure_code_benchmark.cc:165–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165int ErasureCodeBench::encode()
166{
167 ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
168 ErasureCodeInterfaceRef erasure_code;
169 stringstream messages;
170 int code = instance.factory(plugin,
171 g_conf().get_val<std::string>("erasure_code_dir"),
172 profile, &erasure_code, &messages);
173 if (code) {
174 cerr << messages.str() << std::endl;
175 return code;
176 }
177
178 bufferlist in;
179 in.append(string(in_size, 'X'));
180 in.rebuild_aligned(ErasureCode::SIMD_ALIGN);
181 shard_id_set want_to_encode;
182 for (shard_id_t i; i < k + m; ++i) {
183 want_to_encode.insert(i);
184 }
185 utime_t begin_time = ceph_clock_now();
186 for (int i = 0; i < max_iterations; i++) {
187 shard_id_map<bufferlist> encoded(erasure_code->get_chunk_count());
188 code = erasure_code->encode(want_to_encode, in, &encoded);
189 if (code)
190 return code;
191 }
192 utime_t end_time = ceph_clock_now();
193 cout << (end_time - begin_time) << "\t" << (max_iterations * (in_size / 1024)) << std::endl;
194 return 0;
195}
196
197static void display_chunks(const shard_id_map<bufferlist> &chunks,
198 unsigned int chunk_count) {

Callers 15

TESTFunction · 0.45
encode_decodeMethod · 0.45
TEST_FFunction · 0.45
decodeMethod · 0.45
TESTFunction · 0.45
thread4Function · 0.45
thread5Function · 0.45
thread1Function · 0.45
TEST_PFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45

Calls 8

instanceClass · 0.85
ceph_clock_nowFunction · 0.85
rebuild_alignedMethod · 0.80
factoryMethod · 0.45
strMethod · 0.45
appendMethod · 0.45
insertMethod · 0.45
get_chunk_countMethod · 0.45

Tested by

no test coverage detected