cleanup API + add flag to residence status to distinguish loading from creating

This commit is contained in:
Christian Schwarz
2023-02-02 14:22:37 +01:00
committed by Christian Schwarz
parent 8ce21eb7e3
commit 0850d28059
6 changed files with 91 additions and 65 deletions
+9 -4
View File
@@ -256,8 +256,13 @@ pub struct LayerAccessStatFullDetails {
#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
#[serde(tag = "kind")]
pub enum LayerResidenceStatus {
Resident { timestamp_millis_since_epoch: u128 },
Evicted { timestamp_millis_since_epoch: u128 },
Resident {
timestamp_millis_since_epoch: u128,
creating: bool,
},
Evicted {
timestamp_millis_since_epoch: u128,
},
}
#[derive(Debug, Clone, Serialize)]
@@ -300,7 +305,7 @@ pub enum HistoricLayerInfo {
#[serde_as(as = "DisplayFromStr")]
lsn_end: Lsn,
remote: bool,
access_stats: Option<LayerAccessStats>,
access_stats: LayerAccessStats,
},
Image {
layer_file_name: String,
@@ -311,7 +316,7 @@ pub enum HistoricLayerInfo {
#[serde_as(as = "DisplayFromStr")]
lsn_start: Lsn,
remote: bool,
access_stats: Option<LayerAccessStats>,
access_stats: LayerAccessStats,
},
}