MCPcopy Create free account
hub / github.com/ElementsProject/elements / FinishedSingleOp

Method FinishedSingleOp

src/leveldb/benchmarks/db_bench.cc:217–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215 void AddMessage(Slice msg) { AppendWithSpace(&message_, msg); }
216
217 void FinishedSingleOp() {
218 if (FLAGS_histogram) {
219 double now = g_env->NowMicros();
220 double micros = now - last_op_finish_;
221 hist_.Add(micros);
222 if (micros > 20000) {
223 fprintf(stderr, "long op: %.1f micros%30s\r", micros, "");
224 fflush(stderr);
225 }
226 last_op_finish_ = now;
227 }
228
229 done_++;
230 if (done_ >= next_report_) {
231 if (next_report_ < 1000)
232 next_report_ += 100;
233 else if (next_report_ < 5000)
234 next_report_ += 500;
235 else if (next_report_ < 10000)
236 next_report_ += 1000;
237 else if (next_report_ < 50000)
238 next_report_ += 5000;
239 else if (next_report_ < 100000)
240 next_report_ += 10000;
241 else if (next_report_ < 500000)
242 next_report_ += 50000;
243 else
244 next_report_ += 100000;
245 fprintf(stderr, "... finished %d ops%30s\r", done_, "");
246 fflush(stderr);
247 }
248 }
249
250 void AddBytes(int64_t n) { bytes_ += n; }
251

Callers 12

Crc32cMethod · 0.45
SnappyCompressMethod · 0.45
SnappyUncompressMethod · 0.45
OpenBenchMethod · 0.45
DoWriteMethod · 0.45
ReadSequentialMethod · 0.45
ReadReverseMethod · 0.45
ReadRandomMethod · 0.45
ReadMissingMethod · 0.45
ReadHotMethod · 0.45
SeekRandomMethod · 0.45
DoDeleteMethod · 0.45

Calls 2

NowMicrosMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected