global: snapshot

This commit is contained in:
nym21
2026-03-18 12:02:53 +01:00
parent 04ddc6223e
commit b397b811f9
46 changed files with 943 additions and 1197 deletions
+10 -6
View File
@@ -5,7 +5,10 @@ use vecdb::Database;
use super::Vecs;
use crate::{
indexes,
internal::{BlockCountTarget, CachedWindowStarts, PerBlockCumulativeWithSums, ConstantVecs},
internal::{
BlockCountTarget24h, BlockCountTarget1w, BlockCountTarget1m, BlockCountTarget1y,
CachedWindowStarts, PerBlockCumulativeWithSums, ConstantVecs, Windows,
},
};
impl Vecs {
@@ -16,11 +19,12 @@ impl Vecs {
cached_starts: &CachedWindowStarts,
) -> Result<Self> {
Ok(Self {
target: ConstantVecs::new::<BlockCountTarget>(
"block_count_target",
version,
indexes,
),
target: Windows {
_24h: ConstantVecs::new::<BlockCountTarget24h>("block_count_target_24h", version, indexes),
_1w: ConstantVecs::new::<BlockCountTarget1w>("block_count_target_1w", version, indexes),
_1m: ConstantVecs::new::<BlockCountTarget1m>("block_count_target_1m", version, indexes),
_1y: ConstantVecs::new::<BlockCountTarget1y>("block_count_target_1y", version, indexes),
},
total: PerBlockCumulativeWithSums::forced_import(
db,
"block_count",
+2 -2
View File
@@ -2,10 +2,10 @@ use brk_traversable::Traversable;
use brk_types::{StoredU32, StoredU64};
use vecdb::{Rw, StorageMode};
use crate::internal::{PerBlockCumulativeWithSums, ConstantVecs};
use crate::internal::{PerBlockCumulativeWithSums, ConstantVecs, Windows};
#[derive(Traversable)]
pub struct Vecs<M: StorageMode = Rw> {
pub target: ConstantVecs<StoredU64>,
pub target: Windows<ConstantVecs<StoredU64>>,
pub total: PerBlockCumulativeWithSums<StoredU32, StoredU64, M>,
}