If i understand what you are asking, its not as cut and dry as you might think since the safe bounds for some parameters depend on other parameters, so there may not be an absolute threshold that's easy to code.
Some parameters might be easy - i.e., those that the log gives both target and actual like boost and HPFP. So it would be fairly easy to flag if you have significant boost deviation or HPFP pressure dips. Others would be more complicated.
Reading my thread on datalogging is probably a starting point:
https://f30.bimmerpost.com/forums/sh....php?t=1732327