Skip to content

Commit

Permalink
fix(err): actually evict symbol sets (#26827)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverb123 authored Dec 11, 2024
1 parent 8541547 commit 182bb05
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ jobs:
build-id: ${{ needs.container.outputs.build-id }}
tags: ${{ needs.container.outputs.tag }}

- name: Write .env
if: needs.changes.outputs.shouldTriggerCypress == 'true'
- name: Write .env # This step intentionally has no if, so that GH always considers the action as having run
run: |
cat <<EOT >> .env
SECRET_KEY=6b01eee4f945ca25045b5aab440b953461faf08693a9abbf1166dc7c6b9772da
Expand Down
1 change: 1 addition & 0 deletions rust/cymbal/src/metric_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub const STORE_CACHE_MISSES: &str = "cymbal_store_cache_misses";
pub const STORE_CACHED_BYTES: &str = "cymbal_store_cached_bytes";
pub const STORE_CACHE_SIZE: &str = "cymbal_store_cache_size";
pub const STORE_CACHE_EVICTIONS: &str = "cymbal_store_cache_evictions";
pub const STORE_CACHE_EVICTION_RUNS: &str = "cymbal_store_cache_eviction_runs";
pub const MAIN_LOOP_TIME: &str = "cymbal_main_loop_time";
pub const PER_FRAME_TIME: &str = "cymbal_per_frame_time";
pub const PER_STACK_TIME: &str = "cymbal_per_stack_time";
Expand Down
10 changes: 8 additions & 2 deletions rust/cymbal/src/symbol_store/caching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use tokio::sync::Mutex;
use crate::{
error::Error,
metric_consts::{
STORE_CACHED_BYTES, STORE_CACHE_EVICTIONS, STORE_CACHE_HITS, STORE_CACHE_MISSES,
STORE_CACHED_BYTES, STORE_CACHE_EVICTIONS, STORE_CACHE_EVICTION_RUNS, STORE_CACHE_HITS,
STORE_CACHE_MISSES,
},
};

Expand Down Expand Up @@ -117,7 +118,7 @@ impl SymbolSetCache {
return;
}

metrics::counter!(STORE_CACHE_EVICTIONS).increment(1);
metrics::counter!(STORE_CACHE_EVICTION_RUNS).increment(1);

let mut vals: Vec<_> = self.cached.iter().collect();

Expand All @@ -137,6 +138,11 @@ impl SymbolSetCache {
to_remove.push(to_remove_key.clone());
}

for key in to_remove {
metrics::counter!(STORE_CACHE_EVICTIONS).increment(1);
self.cached.remove(&key);
}

metrics::gauge!(STORE_CACHED_BYTES).set(self.held_bytes as f64);
}
}
Expand Down

0 comments on commit 182bb05

Please sign in to comment.