Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rocksdb.file.read.db.open.micros #11455

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Improve the operational safety of publishing a DB or SST files to many hosts by using different block cache hash seeds on different hosts. The exact behavior is controlled by new option `ShardedCacheOptions::hash_seed`, which also documents the solved problem in more detail.
* Introduced a new option `CompactionOptionsFIFO::file_temperature_age_thresholds` that allows FIFO compaction to compact files to different temperatures based on key age (#11428).
* Added a new ticker stat to count how many times RocksDB detected a corruption while verifying a block checksum: `BLOCK_CHECKSUM_MISMATCH_COUNT`.
* New statistics `rocksdb.file.read.db.open.micros` that measures read time of block-based SST tables or blob files during db open.

### Public API Changes
* Add `MakeSharedCache()` construction functions to various cache Options objects, and deprecated the `NewWhateverCache()` functions with long parameter lists.
Expand Down
1 change: 1 addition & 0 deletions file/random_access_file_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const std::array<Histograms, std::size_t(Env::IOActivity::kUnknown)>
kReadHistograms{{
FILE_READ_FLUSH_MICROS,
FILE_READ_COMPACTION_MICROS,
FILE_READ_DB_OPEN_MICROS,
}};
inline void RecordIOStats(Statistics* stats, Temperature file_temperature,
bool is_last_level, size_t size) {
Expand Down
3 changes: 2 additions & 1 deletion include/rocksdb/statistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,10 @@ enum Histograms : uint32_t {
// Time spent in reading block-based or plain SST table
SST_READ_MICROS,
// Time spent in reading SST table (currently only block-based table) or blob
// file for flush or compaction
// file corresponding to `Env::IOActivity`
FILE_READ_FLUSH_MICROS,
FILE_READ_COMPACTION_MICROS,
FILE_READ_DB_OPEN_MICROS,

// The number of subcompactions actually scheduled during a compaction
NUM_SUBCOMPACTIONS_SCHEDULED,
Expand Down
4 changes: 4 additions & 0 deletions java/rocksjni/portal.h
Original file line number Diff line number Diff line change
Expand Up @@ -5627,6 +5627,8 @@ class HistogramTypeJni {
return 0x3A;
case ROCKSDB_NAMESPACE::Histograms::FILE_READ_COMPACTION_MICROS:
return 0x3B;
case ROCKSDB_NAMESPACE::Histograms::FILE_READ_DB_OPEN_MICROS:
return 0x3C;
case ROCKSDB_NAMESPACE::Histograms::HISTOGRAM_ENUM_MAX:
// 0x1F for backwards compatibility on current minor version.
return 0x1F;
Expand Down Expand Up @@ -5750,6 +5752,8 @@ class HistogramTypeJni {
return ROCKSDB_NAMESPACE::Histograms::FILE_READ_FLUSH_MICROS;
case 0x3B:
return ROCKSDB_NAMESPACE::Histograms::FILE_READ_COMPACTION_MICROS;
case 0x3C:
return ROCKSDB_NAMESPACE::Histograms::FILE_READ_DB_OPEN_MICROS;
case 0x1F:
// 0x1F for backwards compatibility on current minor version.
return ROCKSDB_NAMESPACE::Histograms::HISTOGRAM_ENUM_MAX;
Expand Down
2 changes: 2 additions & 0 deletions java/src/main/java/org/rocksdb/HistogramType.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ public enum HistogramType {

FILE_READ_COMPACTION_MICROS((byte) 0x3B),

FILE_READ_DB_OPEN_MICROS((byte) 0x3C),

// 0x1F for backwards compatibility on current minor version.
HISTOGRAM_ENUM_MAX((byte) 0x1F);

Expand Down
1 change: 1 addition & 0 deletions monitoring/statistics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ const std::vector<std::pair<Histograms, std::string>> HistogramsNameMap = {
{SST_READ_MICROS, "rocksdb.sst.read.micros"},
{FILE_READ_FLUSH_MICROS, "rocksdb.file.read.flush.micros"},
{FILE_READ_COMPACTION_MICROS, "rocksdb.file.read.compaction.micros"},
{FILE_READ_DB_OPEN_MICROS, "rocksdb.file.read.db.open.micros"},
{NUM_SUBCOMPACTIONS_SCHEDULED, "rocksdb.num.subcompactions.scheduled"},
{BYTES_PER_READ, "rocksdb.bytes.per.read"},
{BYTES_PER_WRITE, "rocksdb.bytes.per.write"},
Expand Down