Ribbit-Network / ribbit-network-frog-software

The software for the Ribbit Network Frog Sensor
https://www.ribbitnetwork.org/
MIT License
9 stars 8 forks source link

ribbit: Add an heartbeat to detect event loop blocking events #15

Closed damz closed 1 year ago

damz commented 1 year ago

What?

This is going to become annoying very quickly, and we are probably going to want to disable this, especially when we start working on power consumption. But:

Add an heartbeat loop. This is a simple loop that sleeps for 200ms and generates a warning if it woke up after more than 300ms. (In addition, it blinks a LED. Because.)

Why?

Because blocking the event loop for a significant amount of time is the death of collaborative multi-tasking. This is a really important thing to keep an eye on, at least while we are working on this initial version.

What do we learn from this?

We can see (as we know) that DNS requests are blocking. We can also see random blocking of the event loop outside of that, possibly related to reading sensors from the I2C bus.

keenanjohnson commented 1 year ago

Looks good to me!