diff --git a/src/chia_log/handlers/daily_stats/stat_accumulators/eligible_plots_stats.py b/src/chia_log/handlers/daily_stats/stat_accumulators/eligible_plots_stats.py index f2f4e74..97c7104 100644 --- a/src/chia_log/handlers/daily_stats/stat_accumulators/eligible_plots_stats.py +++ b/src/chia_log/handlers/daily_stats/stat_accumulators/eligible_plots_stats.py @@ -21,4 +21,6 @@ def consume(self, obj: HarvesterActivityMessage): self._eligible_events_total += 1 def get_summary(self) -> str: + if self._eligible_events_total == 0: + return "Eligible plots ๐Ÿฅ‡: None" return f"Eligible plots ๐Ÿฅ‡: {self._eligible_plots_total / self._eligible_events_total:0.2f} average" diff --git a/src/chia_log/handlers/daily_stats/stat_accumulators/found_proof_stats.py b/src/chia_log/handlers/daily_stats/stat_accumulators/found_proof_stats.py index 3f9f866..b22624c 100644 --- a/src/chia_log/handlers/daily_stats/stat_accumulators/found_proof_stats.py +++ b/src/chia_log/handlers/daily_stats/stat_accumulators/found_proof_stats.py @@ -18,4 +18,6 @@ def consume(self, obj: HarvesterActivityMessage): self._found_proofs_total += obj.found_proofs_count def get_summary(self) -> str: - return f"Proofs ๐Ÿงพ: {self._found_proofs_total} found" + if self._found_proofs_total == 0: + return "Proofs ๐Ÿงพ: None" + return f"Proofs ๐Ÿงพ: {self._found_proofs_total} found!" diff --git a/src/chia_log/handlers/daily_stats/stat_accumulators/search_time_stats.py b/src/chia_log/handlers/daily_stats/stat_accumulators/search_time_stats.py index d7df687..d3b3ea0 100644 --- a/src/chia_log/handlers/daily_stats/stat_accumulators/search_time_stats.py +++ b/src/chia_log/handlers/daily_stats/stat_accumulators/search_time_stats.py @@ -9,19 +9,29 @@ class SearchTimeStats(HarvesterActivityConsumer, StatAccumulator): def __init__(self): self._last_reset_time = datetime.now() self._num_measurements = 0 - self._max_time_seconds = 0 self._avg_time_seconds = 0 + self._over_5_seconds = 0 + self._over_15_seconds = 0 def reset(self): self._last_reset_time = datetime.now() self._num_measurements = 0 - self._max_time_seconds = 0 self._avg_time_seconds = 0 + self._over_5_seconds = 0 + self._over_15_seconds = 0 def consume(self, obj: HarvesterActivityMessage): self._num_measurements += 1 - self._max_time_seconds = max(self._max_time_seconds, obj.search_time_seconds) self._avg_time_seconds += (obj.search_time_seconds - self._avg_time_seconds) / self._num_measurements + if obj.search_time_seconds > 5: + self._over_5_seconds += 1 + if obj.search_time_seconds > 15: + self._over_15_seconds += 1 def get_summary(self) -> str: - return f"Search ๐Ÿ”: {self._avg_time_seconds:0.2f}s average, {self._max_time_seconds:0.2f}s max" + return ( + f"Search ๐Ÿ”: \n" + f"\t - average: {self._avg_time_seconds:0.2f}s average\n" + f"\t - over 5s: {self._over_5_seconds} occasions\n" + f"\t - over 15s: {self._over_15_seconds} occasions" + ) diff --git a/src/chia_log/handlers/daily_stats/stat_accumulators/signage_point_stats.py b/src/chia_log/handlers/daily_stats/stat_accumulators/signage_point_stats.py index 4f8a515..e61eb6b 100644 --- a/src/chia_log/handlers/daily_stats/stat_accumulators/signage_point_stats.py +++ b/src/chia_log/handlers/daily_stats/stat_accumulators/signage_point_stats.py @@ -34,7 +34,9 @@ def consume(self, obj: FinishedSignagePointMessage): self._last_signage_point = obj.signage_point def get_summary(self) -> str: - percentage_skipped = (self._skips_total / self._total) * 100 + if self._total == 0: + return "Skipped SPs โš ๏ธ: Unknown" if self._skips_total > 0: + percentage_skipped = (self._skips_total / self._total) * 100 return f"Skipped SPs โš ๏ธ: {self._skips_total} ({percentage_skipped:0.2f}%)" return "Skipped SPs โœ…๏ธ: None" diff --git a/src/config.py b/src/config.py index f3ef0af..f54a3f2 100644 --- a/src/config.py +++ b/src/config.py @@ -51,5 +51,6 @@ def check_keys(required_keys, config) -> bool: return False return True + def is_win_platform() -> bool: return sys.platform.startswith("win")