mirror of
https://github.com/neondatabase/neon.git
synced 2026-10-29 06:56:47 +00:00
use u64 to represent millis since epoch
This commit is contained in:
committed by
Christian Schwarz
parent
72d35a3b32
commit
c9474483e5
@@ -248,7 +248,7 @@ pub enum LayerAccessKind {
|
||||
}
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct LayerAccessStatFullDetails {
|
||||
pub when_millis_since_epoch: u128,
|
||||
pub when_millis_since_epoch: u64,
|
||||
pub task_kind: &'static str,
|
||||
pub access_kind: LayerAccessKind,
|
||||
}
|
||||
@@ -257,11 +257,11 @@ pub struct LayerAccessStatFullDetails {
|
||||
#[serde(tag = "kind")]
|
||||
pub enum LayerResidenceStatus {
|
||||
Resident {
|
||||
timestamp_millis_since_epoch: u128,
|
||||
timestamp_millis_since_epoch: u64,
|
||||
created: bool,
|
||||
},
|
||||
Evicted {
|
||||
timestamp_millis_since_epoch: u128,
|
||||
timestamp_millis_since_epoch: u64,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -125,10 +125,12 @@ pub enum LayerAccessStatsReset {
|
||||
AllStats,
|
||||
}
|
||||
|
||||
fn system_time_to_millis_since_epoch(ts: &SystemTime) -> u128 {
|
||||
fn system_time_to_millis_since_epoch(ts: &SystemTime) -> u64 {
|
||||
ts.duration_since(UNIX_EPOCH)
|
||||
.expect("better to die in this unlikely case than report false stats")
|
||||
.as_millis()
|
||||
.try_into()
|
||||
.expect("64 bits is enough for few more years")
|
||||
}
|
||||
|
||||
impl LayerAccessStatFullDetails {
|
||||
|
||||
Reference in New Issue
Block a user