compaction_iteration_stats.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
  2. // This source code is licensed under both the GPLv2 (found in the
  3. // COPYING file in the root directory) and Apache 2.0 License
  4. // (found in the LICENSE.Apache file in the root directory).
  5. #pragma once
  6. #include <cstdint>
  7. #include "rocksdb/rocksdb_namespace.h"
  8. namespace ROCKSDB_NAMESPACE {
  9. struct CompactionIterationStats {
  10. // Compaction statistics
  11. // Doesn't include records skipped because of
  12. // CompactionFilter::Decision::kRemoveAndSkipUntil.
  13. int64_t num_record_drop_user = 0;
  14. int64_t num_record_drop_hidden = 0;
  15. int64_t num_record_drop_obsolete = 0;
  16. int64_t num_record_drop_range_del = 0;
  17. int64_t num_range_del_drop_obsolete = 0;
  18. // Deletions obsoleted before bottom level due to file gap optimization.
  19. int64_t num_optimized_del_drop_obsolete = 0;
  20. uint64_t total_filter_time = 0;
  21. // Input statistics
  22. // TODO(noetzli): The stats are incomplete. They are lacking everything
  23. // consumed by MergeHelper.
  24. uint64_t num_input_records = 0;
  25. uint64_t num_input_deletion_records = 0;
  26. uint64_t num_input_corrupt_records = 0;
  27. uint64_t total_input_raw_key_bytes = 0;
  28. uint64_t total_input_raw_value_bytes = 0;
  29. // Single-Delete diagnostics for exceptional situations
  30. uint64_t num_single_del_fallthru = 0;
  31. uint64_t num_single_del_mismatch = 0;
  32. // Blob related statistics
  33. uint64_t num_blobs_read = 0;
  34. uint64_t total_blob_bytes_read = 0;
  35. uint64_t num_blobs_relocated = 0;
  36. uint64_t total_blob_bytes_relocated = 0;
  37. // TimedPut diagnostics
  38. // Total number of kTypeValuePreferredSeqno records encountered.
  39. uint64_t num_input_timed_put_records = 0;
  40. // Number of kTypeValuePreferredSeqno records we ended up swapping in
  41. // preferred seqno.
  42. uint64_t num_timed_put_swap_preferred_seqno = 0;
  43. };
  44. } // namespace ROCKSDB_NAMESPACE