pub struct HistoricalData {
pub node_type_averages: HashMap<String, u64>,
pub provider_latencies: HashMap<String, u64>,
pub node_execution_history: HashMap<String, Vec<u64>>,
}Expand description
Historical execution data for improving predictions
Fields§
§node_type_averages: HashMap<String, u64>Node type -> average execution time mapping
provider_latencies: HashMap<String, u64>Provider -> average API latency mapping
node_execution_history: HashMap<String, Vec<u64>>Specific node ID -> execution times
Implementations§
Source§impl HistoricalData
impl HistoricalData
Sourcepub fn update_from_stats(&mut self, _stats: &ExecutionStats)
pub fn update_from_stats(&mut self, _stats: &ExecutionStats)
Update historical data from execution stats
Sourcepub fn get_node_type_average(&self, node_type: &str) -> Option<u64>
pub fn get_node_type_average(&self, node_type: &str) -> Option<u64>
Get average time for a node type
Sourcepub fn get_provider_latency(&self, provider: &str) -> Option<u64>
pub fn get_provider_latency(&self, provider: &str) -> Option<u64>
Get average latency for a provider
Trait Implementations§
Source§impl Clone for HistoricalData
impl Clone for HistoricalData
Source§fn clone(&self) -> HistoricalData
fn clone(&self) -> HistoricalData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HistoricalData
impl Debug for HistoricalData
Source§impl Default for HistoricalData
impl Default for HistoricalData
Source§impl<'de> Deserialize<'de> for HistoricalData
impl<'de> Deserialize<'de> for HistoricalData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HistoricalData
impl RefUnwindSafe for HistoricalData
impl Send for HistoricalData
impl Sync for HistoricalData
impl Unpin for HistoricalData
impl UnwindSafe for HistoricalData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more