layere: record residency changes with download/evict

This commit is contained in:
Joonas Koivunen
2023-08-24 17:03:18 +03:00
parent eccb868a50
commit 39b85cc6fd

View File

@@ -984,6 +984,11 @@ impl LayerE {
kind: tokio::sync::OnceCell::default(),
});
self.access_stats.record_residence_event(
LayerResidenceStatus::Resident,
LayerResidenceEventReason::ResidenceChange,
);
Ok(if self.wanted_evicted.load(Ordering::Acquire) {
// because we reset wanted_evictness earlier, this most likely means when we were downloading someone
// wanted to evict this layer.
@@ -1156,6 +1161,8 @@ impl LayerE {
let res = capture_mtime_and_delete.await;
this.access_stats.record_residence_event(LayerResidenceStatus::Evicted, LayerResidenceEventReason::ResidenceChange);
drop(this.status.send(Status::Evicted));
match res {