Skip to content

Commit ce69613

Browse files
committed
chore(cubestore): Track op name for out of queue operations
1 parent 3c6fc89 commit ce69613

File tree

4 files changed

+188
-151
lines changed

4 files changed

+188
-151
lines changed

rust/cubestore/cubestore/src/cachestore/cache_eviction_manager.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ impl CacheEvictionManager {
575575
store: &Arc<RocksStore>,
576576
) -> Result<KeysVector, CubeError> {
577577
let (expired, stats_total_keys, stats_total_raw_size) = store
578-
.read_operation_out_of_queue(move |db_ref| {
578+
.read_operation_out_of_queue("collect_stats_and_expired_keys", move |db_ref| {
579579
let mut stats_total_keys: u32 = 0;
580580
let mut stats_total_raw_size: u64 = 0;
581581

@@ -624,7 +624,7 @@ impl CacheEvictionManager {
624624
let eviction_proactive_size_threshold = self.eviction_proactive_size_threshold;
625625

626626
let (all_keys, stats_total_keys, stats_total_raw_size, expired_keys) = store
627-
.read_operation_out_of_queue(move |db_ref| {
627+
.read_operation_out_of_queue("collect_allkeys_to_evict", move |db_ref| {
628628
let mut stats_total_keys: u32 = 0;
629629
let mut stats_total_raw_size: u64 = 0;
630630

@@ -768,7 +768,7 @@ impl CacheEvictionManager {
768768
let eviction_proactive_size_threshold = self.eviction_proactive_size_threshold;
769769

770770
let to_delete: Vec<(u64, u32)> = store
771-
.read_operation_out_of_queue(move |db_ref| {
771+
.read_operation_out_of_queue("do_eviction_by_sampling", move |db_ref| {
772772
let mut pending_volume_remove: u64 = 0;
773773

774774
let now_at_start = Utc::now();
@@ -1146,6 +1146,7 @@ impl CacheEvictionManager {
11461146

11471147
let _ = store
11481148
.read_operation_out_of_queue_opt(
1149+
"check_compaction_trigger",
11491150
|db_ref| {
11501151
let start: Option<&[u8]> = None;
11511152
let end: Option<&[u8]> = None;

rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ pub trait CacheStore: DIService + Send + Sync {
876876
impl CacheStore for RocksCacheStore {
877877
async fn cache_all(&self, limit: Option<usize>) -> Result<Vec<IdRow<CacheItem>>, CubeError> {
878878
self.store
879-
.read_operation_out_of_queue(move |db_ref| {
879+
.read_operation_out_of_queue("cache_all", move |db_ref| {
880880
Ok(CacheItemRocksTable::new(db_ref).scan_rows(limit)?)
881881
})
882882
.await
@@ -1510,7 +1510,7 @@ impl CacheStore for RocksCacheStore {
15101510

15111511
async fn compaction(&self) -> Result<(), CubeError> {
15121512
self.store
1513-
.read_operation_out_of_queue(move |db_ref| {
1513+
.read_operation_out_of_queue("compaction", move |db_ref| {
15141514
let start: Option<&[u8]> = None;
15151515
let end: Option<&[u8]> = None;
15161516

@@ -1525,7 +1525,7 @@ impl CacheStore for RocksCacheStore {
15251525

15261526
async fn info(&self) -> Result<CachestoreInfo, CubeError> {
15271527
self.store
1528-
.read_operation_out_of_queue(move |db_ref| {
1528+
.read_operation_out_of_queue("info", move |db_ref| {
15291529
let cache_schema = CacheItemRocksTable::new(db_ref.clone());
15301530
let cache_schema_stats = cache_schema.collect_table_stats_by_extended_index(
15311531
&CacheItemRocksIndex::ByPath,

0 commit comments

Comments
 (0)