Expose cache occupancy via C API (#11327)

Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/11327

Reviewed By: cbi42

Differential Revision: D44422225

Pulled By: ajkr

fbshipit-source-id: 3bfcf47290b3133c151bdfdd181896ba2e6be520
oxigraph-8.3.2
Niklas Fiekas 2 years ago committed by Facebook GitHub Bot
parent b4d78189b3
commit e5a560ec98
  1. 8
      db/c.cc
  2. 6
      include/rocksdb/c.h

@ -4754,6 +4754,14 @@ size_t rocksdb_cache_get_pinned_usage(rocksdb_cache_t* cache) {
return cache->rep->GetPinnedUsage(); return cache->rep->GetPinnedUsage();
} }
size_t rocksdb_cache_get_table_address_count(const rocksdb_cache_t* cache) {
return cache->rep->GetTableAddressCount();
}
size_t rocksdb_cache_get_occupancy_count(const rocksdb_cache_t* cache) {
return cache->rep->GetOccupancyCount();
}
rocksdb_dbpath_t* rocksdb_dbpath_create(const char* path, rocksdb_dbpath_t* rocksdb_dbpath_create(const char* path,
uint64_t target_size) { uint64_t target_size) {
rocksdb_dbpath_t* result = new rocksdb_dbpath_t; rocksdb_dbpath_t* result = new rocksdb_dbpath_t;

@ -2007,6 +2007,7 @@ extern ROCKSDB_LIBRARY_API rocksdb_cache_t*
rocksdb_cache_create_lru_with_strict_capacity_limit(size_t capacity); rocksdb_cache_create_lru_with_strict_capacity_limit(size_t capacity);
extern ROCKSDB_LIBRARY_API rocksdb_cache_t* rocksdb_cache_create_lru_opts( extern ROCKSDB_LIBRARY_API rocksdb_cache_t* rocksdb_cache_create_lru_opts(
rocksdb_lru_cache_options_t*); rocksdb_lru_cache_options_t*);
extern ROCKSDB_LIBRARY_API void rocksdb_cache_destroy(rocksdb_cache_t* cache); extern ROCKSDB_LIBRARY_API void rocksdb_cache_destroy(rocksdb_cache_t* cache);
extern ROCKSDB_LIBRARY_API void rocksdb_cache_disown_data( extern ROCKSDB_LIBRARY_API void rocksdb_cache_disown_data(
rocksdb_cache_t* cache); rocksdb_cache_t* cache);
@ -2018,8 +2019,13 @@ extern ROCKSDB_LIBRARY_API size_t
rocksdb_cache_get_usage(rocksdb_cache_t* cache); rocksdb_cache_get_usage(rocksdb_cache_t* cache);
extern ROCKSDB_LIBRARY_API size_t extern ROCKSDB_LIBRARY_API size_t
rocksdb_cache_get_pinned_usage(rocksdb_cache_t* cache); rocksdb_cache_get_pinned_usage(rocksdb_cache_t* cache);
extern ROCKSDB_LIBRARY_API size_t
rocksdb_cache_get_table_address_count(const rocksdb_cache_t* cache);
extern ROCKSDB_LIBRARY_API size_t
rocksdb_cache_get_occupancy_count(const rocksdb_cache_t* cache);
/* HyperClockCache */ /* HyperClockCache */
extern ROCKSDB_LIBRARY_API rocksdb_hyper_clock_cache_options_t* extern ROCKSDB_LIBRARY_API rocksdb_hyper_clock_cache_options_t*
rocksdb_hyper_clock_cache_options_create(size_t capacity, rocksdb_hyper_clock_cache_options_create(size_t capacity,
size_t estimated_entry_charge); size_t estimated_entry_charge);

Loading…
Cancel
Save