martomi / chiadog

A watch dog providing a peace in mind that your Chia farm is running smoothly 24/7.
MIT License
457 stars 120 forks source link

Add HTTP stat reporter #76

Closed greimela closed 3 years ago

greimela commented 3 years ago

This PR adds a stat reporter that reports accumulated stats to a HTTP endpoint. It reuses the same stat_accumulators as the daily stats reporter, in a structured format.

The resulting event currently looks like this:

{
  'timestamp': 1620117180, 
  'found_proofs_total': 1, 
  'search_time_average': 0.32, 
  'search_time_over_5s_count': 3, 
  'search_time_over_15s_count': 0, 
  'current_plot_count': 1234, 
  'eligible_plots_average': 10.17, 
  'signage_point_count': 25, 
  'skipped_signage_point_count': 0
}
martomi commented 3 years ago

The implementation fits fairly nicely in the current architecture. However, I personally don't see much value in sending that information to external HTTP API, especially after implementing https://github.com/martomi/chiadog/issues/69 which essentially brings the same information as notifications at the frequency the user wants.

I can see some value in seeing aggregated historical data charts but it's very likely that such an external HTTP aggregator will need to collect more data to grow and further differentiate from the existing notifications. That expansion will be in direct conflict with the idea of keeping this tool simple & minimal.

For that reason, I'd say a fork or a separate tool (which can reuse the parsers from here as per the MIT license) would be the viable long-term choice for this development.

greimela commented 3 years ago

I understand your valid concerns and agree that chiadog should stay as minimal as possible! Therefore, I will close this PR for now.

Still, there are some aspects that fit very nicely in the context of the chiadog as a notification tool, e.g. a central monitoring of a decentralized farm with multiple harvesters. This use case is currently not well supported, since each device has its own chiadog process, inspecting its own log.

But as you said, a new tool could reuse relevant parts from this project and build on it! Thanks again for making this tool open source! 😉