mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-24 17:38:09 -07:00
global: snapshot part 4
This commit is contained in:
@@ -5,7 +5,7 @@ use vecdb::Database;
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{CachedWindowStarts, PerBlockCumulativeWithSums},
|
||||
internal::{CachedWindowStarts, PerBlockCumulativeRolling},
|
||||
};
|
||||
|
||||
impl Vecs {
|
||||
@@ -16,9 +16,9 @@ impl Vecs {
|
||||
cached_starts: &CachedWindowStarts,
|
||||
) -> Result<Self> {
|
||||
Ok(Self {
|
||||
v1: PerBlockCumulativeWithSums::forced_import(db, "tx_v1", version, indexes, cached_starts)?,
|
||||
v2: PerBlockCumulativeWithSums::forced_import(db, "tx_v2", version, indexes, cached_starts)?,
|
||||
v3: PerBlockCumulativeWithSums::forced_import(db, "tx_v3", version, indexes, cached_starts)?,
|
||||
v1: PerBlockCumulativeRolling::forced_import(db, "tx_v1", version, indexes, cached_starts)?,
|
||||
v2: PerBlockCumulativeRolling::forced_import(db, "tx_v2", version, indexes, cached_starts)?,
|
||||
v3: PerBlockCumulativeRolling::forced_import(db, "tx_v3", version, indexes, cached_starts)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ use brk_traversable::Traversable;
|
||||
use brk_types::StoredU64;
|
||||
use vecdb::{Rw, StorageMode};
|
||||
|
||||
use crate::internal::PerBlockCumulativeWithSums;
|
||||
use crate::internal::PerBlockCumulativeRolling;
|
||||
|
||||
#[derive(Traversable)]
|
||||
pub struct Vecs<M: StorageMode = Rw> {
|
||||
pub v1: PerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
pub v2: PerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
pub v3: PerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
pub v1: PerBlockCumulativeRolling<StoredU64, StoredU64, M>,
|
||||
pub v2: PerBlockCumulativeRolling<StoredU64, StoredU64, M>,
|
||||
pub v3: PerBlockCumulativeRolling<StoredU64, StoredU64, M>,
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ use vecdb::Database;
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{AmountPerBlockCumulativeWithSums, CachedWindowStarts, PerBlock, Windows},
|
||||
internal::{AmountPerBlockCumulativeRolling, CachedWindowStarts, PerBlock, Windows},
|
||||
};
|
||||
|
||||
impl Vecs {
|
||||
@@ -17,7 +17,7 @@ impl Vecs {
|
||||
) -> Result<Self> {
|
||||
let v = version + Version::TWO;
|
||||
Ok(Self {
|
||||
transfer_volume: AmountPerBlockCumulativeWithSums::forced_import(
|
||||
transfer_volume: AmountPerBlockCumulativeRolling::forced_import(
|
||||
db,
|
||||
"transfer_volume_bis",
|
||||
version,
|
||||
|
||||
@@ -2,11 +2,11 @@ use brk_traversable::Traversable;
|
||||
use brk_types::StoredF32;
|
||||
use vecdb::{Rw, StorageMode};
|
||||
|
||||
use crate::internal::{AmountPerBlockCumulativeWithSums, PerBlock, Windows};
|
||||
use crate::internal::{AmountPerBlockCumulativeRolling, PerBlock, Windows};
|
||||
|
||||
#[derive(Traversable)]
|
||||
pub struct Vecs<M: StorageMode = Rw> {
|
||||
pub transfer_volume: AmountPerBlockCumulativeWithSums<M>,
|
||||
pub transfer_volume: AmountPerBlockCumulativeRolling<M>,
|
||||
pub tx_per_sec: Windows<PerBlock<StoredF32, M>>,
|
||||
pub outputs_per_sec: Windows<PerBlock<StoredF32, M>>,
|
||||
pub inputs_per_sec: Windows<PerBlock<StoredF32, M>>,
|
||||
|
||||
Reference in New Issue
Block a user