I wrote a Node-Red flow to do that.

However, if you are measuring your import, why do you need that?