pub struct PerformanceDatabase<A: Float> { /* private fields */ }Expand description
Historical performance database
Implementations§
Source§impl<A: Float + Debug + Serialize + for<'de> Deserialize<'de> + Send + Sync> PerformanceDatabase<A>
impl<A: Float + Debug + Serialize + for<'de> Deserialize<'de> + Send + Sync> PerformanceDatabase<A>
Sourcepub fn add_record(&mut self, key: String, record: PerformanceRecord<A>)
pub fn add_record(&mut self, key: String, record: PerformanceRecord<A>)
Add a performance record with history size management
Sourcepub fn add_record_with_limit(
&mut self,
key: String,
record: PerformanceRecord<A>,
max_history: usize,
)
pub fn add_record_with_limit( &mut self, key: String, record: PerformanceRecord<A>, max_history: usize, )
Add a performance record with custom history limit
Sourcepub fn get_history(&self, key: &str) -> Option<&VecDeque<PerformanceRecord<A>>>
pub fn get_history(&self, key: &str) -> Option<&VecDeque<PerformanceRecord<A>>>
Get performance history for a specific key
Sourcepub fn get_history_mut(
&mut self,
key: &str,
) -> Option<&mut VecDeque<PerformanceRecord<A>>>
pub fn get_history_mut( &mut self, key: &str, ) -> Option<&mut VecDeque<PerformanceRecord<A>>>
Get mutable performance history for a specific key
Sourcepub fn get_recent_records(
&self,
key: &str,
count: usize,
) -> Vec<&PerformanceRecord<A>>
pub fn get_recent_records( &self, key: &str, count: usize, ) -> Vec<&PerformanceRecord<A>>
Get recent records for a key (last N records)
Sourcepub fn cleanup_old_records(&mut self, cutoff_timestamp: u64) -> usize
pub fn cleanup_old_records(&mut self, cutoff_timestamp: u64) -> usize
Remove old records based on timestamp (older than given timestamp)
Sourcepub fn total_records(&self) -> usize
pub fn total_records(&self) -> usize
Get total number of records across all keys
Sourcepub fn metadata(&self) -> &DatabaseMetadata
pub fn metadata(&self) -> &DatabaseMetadata
Get database metadata
Sourcepub fn get_records_by_commit(
&self,
commit_hash: &str,
) -> Vec<(&String, &PerformanceRecord<A>)>
pub fn get_records_by_commit( &self, commit_hash: &str, ) -> Vec<(&String, &PerformanceRecord<A>)>
Get records for a specific commit hash
Sourcepub fn get_records_by_branch(
&self,
branch: &str,
) -> Vec<(&String, &PerformanceRecord<A>)>
pub fn get_records_by_branch( &self, branch: &str, ) -> Vec<(&String, &PerformanceRecord<A>)>
Get records for a specific branch
Sourcepub fn get_records_by_time_range(
&self,
start_timestamp: u64,
end_timestamp: u64,
) -> Vec<(&String, &PerformanceRecord<A>)>
pub fn get_records_by_time_range( &self, start_timestamp: u64, end_timestamp: u64, ) -> Vec<(&String, &PerformanceRecord<A>)>
Get records within a time range
Sourcepub fn export_json(&self) -> Result<String>
pub fn export_json(&self) -> Result<String>
Export database to JSON string
Sourcepub fn import_json(json_data: &str) -> Result<Self>
pub fn import_json(json_data: &str) -> Result<Self>
Import database from JSON string
Sourcepub fn merge(&mut self, other: PerformanceDatabase<A>)
pub fn merge(&mut self, other: PerformanceDatabase<A>)
Merge another database into this one
Trait Implementations§
Source§impl<A: Float + Debug + Serialize + for<'de> Deserialize<'de> + Send + Sync> Default for PerformanceDatabase<A>
impl<A: Float + Debug + Serialize + for<'de> Deserialize<'de> + Send + Sync> Default for PerformanceDatabase<A>
Source§impl<'de, A> Deserialize<'de> for PerformanceDatabase<A>where
A: Deserialize<'de> + Float,
impl<'de, A> Deserialize<'de> for PerformanceDatabase<A>where
A: Deserialize<'de> + Float,
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<A> Freeze for PerformanceDatabase<A>
impl<A> RefUnwindSafe for PerformanceDatabase<A>where
A: RefUnwindSafe,
impl<A> Send for PerformanceDatabase<A>where
A: Send,
impl<A> Sync for PerformanceDatabase<A>where
A: Sync,
impl<A> Unpin for PerformanceDatabase<A>where
A: Unpin,
impl<A> UnsafeUnpin for PerformanceDatabase<A>
impl<A> UnwindSafe for PerformanceDatabase<A>where
A: UnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.