I figured something like this out a while back, maybe it will help.
Precompose the layer you want to calculate the area for and make sure the background is transparent. On the precomposed layer, add a slider expression control, alt click the slider and apply this expression:
sampleArea = [thisComp.width,thisComp.height]; // Specifies the comp frame dimensions
color = sampleImage(sampleArea*0.5,sampleArea); // Samples the colors of entire frame area
100*(color[3]*4) // Returns the percentage of Alpha within the frame
Note: You should be in 16 or 32bpc for this to be accurate and I don’t think multiprocessing will work with the “sampleImage” expression.
I hope this was helpful. Good luck.
Peter Diefenthaler
https://www.ideafirecreative.com/