For that purpose it is OK. I’m not a big fan of doing a lot in interrupts, but the situation you sketch is a good example of when it can be fine to do so.
If you want an alternative option, you could look into “preserving” some RAM upon reset. It’s a lot nicer as you won’t have to wear your flash, depending on how often you’re expecting this to happen.
In that case writing your statistics to a reserved location in the RAM upon early warning would be preferable. This, of course, assumes there is no power cycling.
But, as I said before, your option is fine too. Just don’t do it too often.
I’m not exactly sure what the problem is then?