This is very similar to my flow. I start a 25 minute timer, and work for at least that amount of time, if I get interrupted during that first 25 minutes I count that as an interruption (which I tally). From there I count the number of 25 minute blocks I work, which include any rolling timers (25 minute blocks after the first 25 minutes).
I did this on paper for a few months and eventually turned it into an app called Contadino for macOS, iOS, watchOS, and visionOS (https://apps.apple.com/us/app/contadino/id1672167389).