Skip to content

Commit 33d541d

Browse files
zzylolclaude
andcommitted
revert: remove legacy store changes, diagnostics now live in current stores
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8661b52 commit 33d541d

3 files changed

Lines changed: 1 addition & 106 deletions

File tree

asap-query-engine/src/stores/simple_map_store/legacy/global.rs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -56,51 +56,6 @@ impl LegacySimpleMapStoreGlobal {
5656
}
5757
}
5858

59-
/// Collect diagnostic info for memory leak investigation.
60-
pub fn diagnostic_info(&self) -> super::per_key::StoreDiagnostics {
61-
use super::per_key::{AggregationDiagnostic, StoreDiagnostics};
62-
63-
let data = self.lock.lock().unwrap();
64-
let mut per_aggregation = Vec::new();
65-
let mut total_time_map_entries: usize = 0;
66-
let mut total_sketch_bytes: usize = 0;
67-
68-
for (&agg_id, time_map) in &data.store {
69-
let time_map_len = time_map.len();
70-
let read_counts_len = data
71-
.read_counts
72-
.get(&agg_id)
73-
.map(|rc| rc.len())
74-
.unwrap_or(0);
75-
total_time_map_entries += time_map_len;
76-
77-
let mut num_aggregate_objects: usize = 0;
78-
let mut agg_sketch_bytes: usize = 0;
79-
for store_values in time_map.values() {
80-
num_aggregate_objects += store_values.len();
81-
for (_key, aggregate) in store_values {
82-
agg_sketch_bytes += aggregate.serialize_to_bytes().len();
83-
}
84-
}
85-
total_sketch_bytes += agg_sketch_bytes;
86-
87-
per_aggregation.push(AggregationDiagnostic {
88-
aggregation_id: agg_id,
89-
time_map_len,
90-
read_counts_len,
91-
num_aggregate_objects,
92-
sketch_bytes: agg_sketch_bytes,
93-
});
94-
}
95-
96-
StoreDiagnostics {
97-
num_aggregations: data.store.len(),
98-
total_time_map_entries,
99-
total_sketch_bytes,
100-
per_aggregation,
101-
}
102-
}
103-
10459
fn create_table(&self, data: &mut StoreData, metric: &str) {
10560
// In the in-memory implementation, "creating a table" just means
10661
// marking the metric as known

asap-query-engine/src/stores/simple_map_store/legacy/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ mod global;
22
mod per_key;
33

44
pub use global::LegacySimpleMapStoreGlobal;
5-
pub use per_key::{AggregationDiagnostic, LegacySimpleMapStorePerKey, StoreDiagnostics};
5+
pub use per_key::LegacySimpleMapStorePerKey;

asap-query-engine/src/stores/simple_map_store/legacy/per_key.rs

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,6 @@ pub struct LegacySimpleMapStorePerKey {
4848
cleanup_policy: CleanupPolicy,
4949
}
5050

51-
/// Diagnostic snapshot from a single aggregation ID in the store.
52-
pub struct AggregationDiagnostic {
53-
pub aggregation_id: u64,
54-
pub time_map_len: usize,
55-
pub read_counts_len: usize,
56-
pub num_aggregate_objects: usize,
57-
pub sketch_bytes: usize,
58-
}
59-
60-
/// Diagnostic snapshot of the entire store.
61-
pub struct StoreDiagnostics {
62-
pub num_aggregations: usize,
63-
pub total_time_map_entries: usize,
64-
pub total_sketch_bytes: usize,
65-
pub per_aggregation: Vec<AggregationDiagnostic>,
66-
}
67-
6851
impl LegacySimpleMapStorePerKey {
6952
pub fn new(streaming_config: Arc<StreamingConfig>, cleanup_policy: CleanupPolicy) -> Self {
7053
Self {
@@ -77,49 +60,6 @@ impl LegacySimpleMapStorePerKey {
7760
}
7861
}
7962

80-
/// Collect diagnostic info for memory leak investigation.
81-
pub fn diagnostic_info(&self) -> StoreDiagnostics {
82-
let mut per_aggregation = Vec::new();
83-
let mut total_time_map_entries: usize = 0;
84-
let mut total_sketch_bytes: usize = 0;
85-
86-
for entry in self.store.iter() {
87-
let agg_id = *entry.key();
88-
let data = match entry.value().read() {
89-
Ok(d) => d,
90-
Err(_) => continue,
91-
};
92-
let time_map_len = data.time_map.len();
93-
let read_counts_len = data.read_counts.len();
94-
total_time_map_entries += time_map_len;
95-
96-
let mut num_aggregate_objects: usize = 0;
97-
let mut agg_sketch_bytes: usize = 0;
98-
for store_values in data.time_map.values() {
99-
num_aggregate_objects += store_values.len();
100-
for (_key, aggregate) in store_values {
101-
agg_sketch_bytes += aggregate.serialize_to_bytes().len();
102-
}
103-
}
104-
total_sketch_bytes += agg_sketch_bytes;
105-
106-
per_aggregation.push(AggregationDiagnostic {
107-
aggregation_id: agg_id,
108-
time_map_len,
109-
read_counts_len,
110-
num_aggregate_objects,
111-
sketch_bytes: agg_sketch_bytes,
112-
});
113-
}
114-
115-
StoreDiagnostics {
116-
num_aggregations: self.store.len(),
117-
total_time_map_entries,
118-
total_sketch_bytes,
119-
per_aggregation,
120-
}
121-
}
122-
12363
fn cleanup_old_aggregates_fixed_count(
12464
&self,
12565
data: &mut StoreKeyData,

0 commit comments

Comments
 (0)