Closed centrd closed 3 years ago
+1 to this request.
In addition, I'd love to be able to get a notification when a proof is found, especially since chia's debug.log only goes back 8 files, and it rotates every ~20MB (which is my case is every 40 minutes), which means I only end up with 4-5 hours of logs.
+1 to this request.
In addition, I'd love to be able to get a notification when a proof is found, especially since chia's debug.log only goes back 8 files, and it rotates every ~20MB (which is my case is every 40 minutes), which means I only end up with 4-5 hours of logs.
There is a pull request ready for this functionality. It was briefly disabled due to Chia removing the log line from the debug log. https://github.com/martomi/chiadog/pull/74
Currently, chiadog can send a daily stats report, which is awesome. Request:
- Add a config field to set the frequency of this report, e.g. every 5 hours, every 1 hour, etc. This is especially helpful while troubleshooting issues with the farmer.
- Add the ability to trigger a stats notifications manually. Again, this is helpful for troubleshooting. It would be extra nice if this were possible to call via CLI, a script, or cron.
Regarding 1) so basically you'd like to have a user-defined interval for daily stats? Config would look something like this then:
daily_stats:
enable: true
start_at: 21:15
interval: 3600 # interval in seconds or preset: [hourly, daily, weekly]
Regarding 2) I've been thinking of a way to implement this. Since Chiadog keeps its state in memory, I can think of two possible ways:
stats.py --config config.yaml
read from that database, send a notification and exitkeyboard
and fire off a manual trigger when you press a specific key/combination (like ctrl+t) from the existing main.py process. I'm leaning towards the second implementation... If anyone can think of any other ways, please elaborate on them here.
Regarding 2:
How about running main.py
normally, wait for a small time (e.g. 30s) to aggregate some logs, and then send the stat report? This would be like your option 1, but without the shared database.
This mode could be triggered by an option --test-stats
or so.
@greimela sounds a lot like what I also proposed here https://github.com/martomi/chiadog/pull/82#pullrequestreview-652641997 - maybe the ideas can be combined to some extend. But let's keep it very simple.
Simplest would be to have that option to send notification immediately and to also have interval_hours
config that defaults to 24 but people can set it to e.g. 8 for morning, afternoon, evening notifications or to 1 for debugging stuff.
Regarding 1) so basically you'd like to have a user-defined interval for ~daily~ stats? Config would look something like this then:
daily_stats: enable: true start_at: 21:15 interval: 3600 # interval in seconds or preset: [hourly, daily, weekly]
Maybe use a cron like schedule configuration?
For example (splunk) cron_schedule = /15 6-18
Every fifteen minutes between 6AM and 6PM
Don't know if there is easy support for that in Python
Cron will be an overcomplication for a lot of the people currently using the tool in my opinion, so I'd prefer to stay away from that.
Currently, chiadog can send a daily stats report, which is awesome. Request:
Add a config field to set the frequency of this report, e.g. every 5 hours, every 1 hour, etc. This is especially helpful while troubleshooting issues with the farmer.
Add the ability to trigger a stats notifications manually. Again, this is helpful for troubleshooting. It would be extra nice if this were possible to call via CLI, a script, or cron.