golioth / golioth-firmware-sdk

Firmware SDK enabling any IoT device to connect to Golioth - the Universal Connector for IoT
https://golioth.io
Apache License 2.0
53 stars 11 forks source link

zephyr: coap: periodically report resend count #516

Closed szczys closed 2 weeks ago

szczys commented 2 weeks ago

Sum the number of coap request resends over a period of time and report as an INF log message. Change the existing resend message to DBG level so it is still available when that log level is selected via Kconfig.

I'm proposing this approach as an alternative to #500. We had originally discussed changing the log level of zephyr_coap_req.c in only the golioth log backend so the messages are reported in the terminal but not sent to the cloud. This has two disadvantages:

This PR is a rather small resource change (adds 6 bytes to the Golioth client) and low overhead (we already have the uptime value so it's just a some subtraction/multiplication on each conditional).

resolves https://github.com/golioth/firmware-issue-tracker/issues/576 closes #500

github-actions[bot] commented 2 weeks ago

Visit the preview URL for this PR (updated for commit 5e0f8e6):

https://golioth-firmware-sdk-doxygen-dev--pr516-szczys-coap-re-ntnos4zm.web.app

(expires Thu, 20 Jun 2024 14:06:58 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a9993e61697a3983f3479e468bcb0b616f9a0578