Measure liquid amount from the pump

If the amount is regular, you might use a tank with a couple of float switches and a dump valve.