Monitor SD card write speed

I’ve been running HA on a Pi3 for 1.5 years now and generally love it. The one thing however I don’t love, is replacing the SD card every ~6 months.

I’m considering upgrading to a NUC or something like that, but in the meantime I’m wondering if anyone has put any thought into a HA sensor that could monitor system disk read/write speeds and graph it over time. This could potentially provide a good indicator for SD card health. I’m not sure how it would work… possibly logging the averages from something like iotop and graphing them. Or maybe a nightly script that would shut down HA and mariadb and then run hdparm.

Just wanted to throw that out there an case anyone else has thought about a solution. Any ideas?