]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
[RocksDB] Added nano second stopwatch and new perf counters to track block read cost
authorHaobo Xu <haobo@fb.com>
Tue, 4 Jun 2013 06:09:15 +0000 (23:09 -0700)
committerHaobo Xu <haobo@fb.com>
Sun, 8 Sep 2013 04:14:54 +0000 (21:14 -0700)
commitf2f4c8072ff20072f2ff665308e01d3b571d398f
treeb7bde753948c58d986d753a55a66082f65580a2e
parent32c965d41790e8d5e4bb14c559a827eb12c8babf
[RocksDB] Added nano second stopwatch and new perf counters to track block read cost

Summary: The pupose of this diff is to expose per user-call level precise timing of block read, so that we can answer questions like: a Get() costs me 100ms, is that somehow related to loading blocks from file system, or sth else? We will answer that with EXACTLY how many blocks have been read, how much time was spent on transfering the bytes from os, how much time was spent on checksum verification and how much time was spent on block decompression, just for that one Get. A nano second stopwatch was introduced to track time with higher precision. The cost/precision of the stopwatch is also measured in unit-test. On my dev box, retrieving one time instance costs about 30ns, on average. The deviation of timing results is good enough to track 100ns-1us level events. And the overhead could be safely ignored for 100us level events (10000 instances/s), for example, a viewstate thrift call.

Test Plan: perf_context_test, also testing with viewstate shadow traffic.

Reviewers: dhruba

Reviewed By: dhruba

CC: leveldb, xjin
Differential Revision: https://reviews.facebook.net/D12351
13 files changed:
build_tools/build_detect_platform
db/dbformat.cc
db/perf_context.cc [deleted file]
db/perf_context_test.cc
include/rocksdb/env.h
include/rocksdb/perf_context.h
table/format.cc
table/format.h
table/table.cc
util/env_posix.cc
util/perf_context.cc [new file with mode: 0644]
util/perf_context_imp.h [new file with mode: 0644]
util/stop_watch.h