Measuring performance stats with text-stats

Hey all,

for my graduation project I need to measure the performance of various Panda3D scenes in terms of FPS, used memory, geometry loading times, etc., and compare them to one another. I’ve setup a path for the cam to travel in each scene and vary the complexity and number of objects contained therein. The differences in the scenes can be quite large: worst case runs at 300 FPS/300 MB vs. best case at 600 FPS / 80 MB graphics memory.

I pull these values through text-stats (i.e. save the stream to a file, parse and visualise it). The problem is that the measurement frequency of text-stats depends on the scene’s FPS. This means that I get a lot of values for high FPS scenes and less otherwise. The real trouble is that some of my frames are dropped (which in my specific case is not a problem) which results in missing measurement values. It makes comparing the different cases impossible.

My question is: can I somehow tell text-stats to take measurements only once in n seconds?

The docs state that PStatClient’s output can be limited through its setMaxRate function ( but I am confused.
Normally PStatClient sends a packet every frame, but setMaxRate can limit it to a certain value per second… shouldn’t it be limiting it to a certain value per frame, seeing that it normally operates based on frames. Also, what is a packet? Is it a dump of all collectors? What happens if I set it to 0.5 i.e. half a packet per second, does it automatically send the whole packet every 2 seconds?

The broad question is thus: how can I automatically extract performance measurements from Panda3D every n seconds?

Thanks in advance!

PS The frame drops are not a problem as they last 1-1.5 sec at known locations (since the path I take is always the same). Hence if I can take measurements every n seconds I can time my measurements to happen just before and after a frame drop occurs. Of course, I would prefer not to drop frames but fixing that is not my prime concern at the moment.