File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed
rust/cubestore/cubestore/src Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -352,7 +352,15 @@ impl RocksCacheStore {
352352 Ok ( ( ) )
353353 }
354354
355+ fn send_zero_gauge_stats ( & self ) {
356+ app_metrics:: CACHESTORE_ROCKSDB_ESTIMATE_LIVE_DATA_SIZE . report ( 0 ) ;
357+ app_metrics:: CACHESTORE_ROCKSDB_LIVE_SST_FILES_SIZE . report ( 0 ) ;
358+ app_metrics:: CACHESTORE_ROCKSDB_CF_DEFAULT_SIZE . report ( 0 ) ;
359+ }
360+
355361 pub async fn stop_processing_loops ( & self ) {
362+ self . send_zero_gauge_stats ( ) ;
363+
356364 self . cache_eviction_manager . stop_processing_loops ( ) ;
357365 self . upload_loop . stop ( ) ;
358366 self . metrics_loop . stop ( ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use crate::cachestore::CacheStore;
22use crate :: config:: ConfigObj ;
33use crate :: metastore:: MetaStoreEvent ;
44use crate :: shared:: deadline_queue:: DeadlineQueue ;
5- use crate :: CubeError ;
5+ use crate :: { app_metrics , CubeError } ;
66use datafusion:: cube_ext;
77use log:: error;
88use std:: sync:: Arc ;
@@ -130,7 +130,13 @@ impl CacheStoreSchedulerImpl {
130130 }
131131 }
132132
133+ fn send_zero_gauge_stats ( & self ) {
134+ app_metrics:: CACHESTORE_SCHEDULER_GC_QUEUE . report ( 0 ) ;
135+ }
136+
133137 pub fn stop_processing_loops ( & self ) -> Result < ( ) , CubeError > {
138+ self . send_zero_gauge_stats ( ) ;
139+
134140 self . cancel_token . cancel ( ) ;
135141 Ok ( ( ) )
136142 }
Original file line number Diff line number Diff line change @@ -209,6 +209,13 @@ impl SqlResultCache {
209209 }
210210}
211211
212+ impl Drop for SqlResultCache {
213+ fn drop ( & mut self ) {
214+ app_metrics:: DATA_QUERIES_CACHE_SIZE . report ( 0 ) ;
215+ app_metrics:: DATA_QUERIES_CACHE_WEIGHT . report ( 0 ) ;
216+ }
217+ }
218+
212219#[ cfg( test) ]
213220mod tests {
214221 use crate :: queryplanner:: serialized_plan:: SerializedPlan ;
You can’t perform that action at this time.
0 commit comments