Hall Effect Sensor connected to GPIO pins - How can I could pulses per minute?

Hi all,

I have a hall effect sensor connected to my Pi GPIO pins and the pulses are coming in fine. It's a water flow meter connected to an irrigation system for a community.

However, I have no idea as to how best (or even how full stop) to count the pulses per minute (to monitor the flow). My main aim is to alert if a pipe is leaking but I'd like to also monitor usage.

Last year, we had a pipe which leaked for over a month and cost us €15k in water charges - which we had no choice but to pay !!!

The node node-red-contrib-msg-speed can tell you how many messages arrived in a given period.

A flow like this might work to display usage and detect leaks: