6878cedcc3
Summary: The patch adds statistics support to the integrated BlobDB implementation, namely the tickers `BLOB_DB_BLOB_FILE_BYTES_READ` and `BLOB_DB_GC_{NUM_KEYS,BYTES}_RELOCATED`, and the histograms `BLOB_DB_(DE)COMPRESSION_MICROS`. (Some other statistics, like `BLOB_DB_BLOB_FILE_BYTES_WRITTEN`, `BLOB_DB_BLOB_FILE_SYNCED`, `BLOB_DB_BLOB_FILE_{READ,WRITE,SYNC}_MICROS` were already supported.) Note that the vast majority of the old BlobDB's tickers/histograms are not really applicable to the new implementation, since they e.g. pertain to calling dedicated BlobDB APIs (which the integrated BlobDB does not have) or are tied to the legacy BlobDB's design of writing blob files synchronously when a write API is called. Such statistics are marked "legacy BlobDB only" in `statistics.h`. Fixes https://github.com/facebook/rocksdb/issues/8645 . Pull Request resolved: https://github.com/facebook/rocksdb/pull/8667 Test Plan: Ran `make check` and tested the new statistics using `db_bench`. Reviewed By: riversand963 Differential Revision: D30356884 Pulled By: ltamasi fbshipit-source-id: 5f8a833faee60401c5643c2f0a6c0415488190a4
44 lines
1.5 KiB
C
44 lines
1.5 KiB
C
// Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
|
|
// This source code is licensed under both the GPLv2 (found in the
|
|
// COPYING file in the root directory) and Apache 2.0 License
|
|
// (found in the LICENSE.Apache file in the root directory).
|
|
|
|
#pragma once
|
|
|
|
#include "rocksdb/rocksdb_namespace.h"
|
|
|
|
struct CompactionIterationStats {
|
|
// Compaction statistics
|
|
|
|
// Doesn't include records skipped because of
|
|
// CompactionFilter::Decision::kRemoveAndSkipUntil.
|
|
int64_t num_record_drop_user = 0;
|
|
|
|
int64_t num_record_drop_hidden = 0;
|
|
int64_t num_record_drop_obsolete = 0;
|
|
int64_t num_record_drop_range_del = 0;
|
|
int64_t num_range_del_drop_obsolete = 0;
|
|
// Deletions obsoleted before bottom level due to file gap optimization.
|
|
int64_t num_optimized_del_drop_obsolete = 0;
|
|
uint64_t total_filter_time = 0;
|
|
|
|
// Input statistics
|
|
// TODO(noetzli): The stats are incomplete. They are lacking everything
|
|
// consumed by MergeHelper.
|
|
uint64_t num_input_records = 0;
|
|
uint64_t num_input_deletion_records = 0;
|
|
uint64_t num_input_corrupt_records = 0;
|
|
uint64_t total_input_raw_key_bytes = 0;
|
|
uint64_t total_input_raw_value_bytes = 0;
|
|
|
|
// Single-Delete diagnostics for exceptional situations
|
|
uint64_t num_single_del_fallthru = 0;
|
|
uint64_t num_single_del_mismatch = 0;
|
|
|
|
// Blob related statistics
|
|
uint64_t num_blobs_read = 0;
|
|
uint64_t total_blob_bytes_read = 0;
|
|
uint64_t num_blobs_relocated = 0;
|
|
uint64_t total_blob_bytes_relocated = 0;
|
|
};
|