Skip to content

Commit

Permalink
WIP in mem blob cache
Browse files Browse the repository at this point in the history
  • Loading branch information
danhhz committed Jan 3, 2024
1 parent 164c892 commit 1a64c74
Show file tree
Hide file tree
Showing 4 changed files with 396 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/persist-client/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use tracing::{debug, instrument};

use crate::async_runtime::IsolatedRuntime;
use crate::error::{CodecConcreteType, CodecMismatch};
use crate::internal::cache::BlobMemCache;
use crate::internal::machine::retry_external;
use crate::internal::metrics::{LockMetrics, Metrics, MetricsBlob, MetricsConsensus, ShardMetrics};
use crate::internal::state::TypedState;
Expand Down Expand Up @@ -218,6 +219,9 @@ impl PersistClientCache {
Self::PROMETHEUS_SCRAPE_INTERVAL,
)
.await;
// This is intentionally "outside" (wrapping) MetricsBlob so
// that we don't include cached responses in blob metrics.
let blob = BlobMemCache::new(&self.cfg, Arc::clone(&self.metrics), blob);
Arc::clone(&x.insert((RttLatencyTask(task.abort_on_drop()), blob)).1)
}
};
Expand Down
Loading

0 comments on commit 1a64c74

Please sign in to comment.