Node Uptime (#196)

* fix: node stats updating live
* fix: Propagation time for first node to hit a block
* chore: Leaner feed serialization
* fix: Handle old nodes with stringified network_state
* feat: Add Node Uptime to the list
* chore: Remove old backend from test pipeline
This commit is contained in:
Maciej Hirsz
2019-11-09 12:16:39 +01:00
committed by GitHub
parent b69adbb096
commit 3e34720f66
20 changed files with 126 additions and 85 deletions
+7 -2
View File
@@ -9,8 +9,11 @@ pub struct MeanList<T> where T: Float + AddAssign + Zero + From<u8> {
ticks_per_mean: u8,
}
impl<T> MeanList<T> where T: Float + AddAssign + Zero + From<u8> {
pub fn new() -> MeanList<T> {
impl<T> Default for MeanList<T>
where
T: Float + AddAssign + Zero + From<u8>,
{
fn default() -> MeanList<T> {
MeanList {
period_sum: T::zero(),
period_count: 0,
@@ -19,7 +22,9 @@ impl<T> MeanList<T> where T: Float + AddAssign + Zero + From<u8> {
ticks_per_mean: 1,
}
}
}
impl<T> MeanList<T> where T: Float + AddAssign + Zero + From<u8> {
pub fn slice(&self) -> &[T] {
&self.means[..usize::from(self.mean_index)]
}