Search - User list
Full Version: Tops and PerfMon
Root » PDG/TOPs » Tops and PerfMon
Is there a way to start a performance monitor profile when starting the execution of a TOPs network then stop and save it when it is finished? Looking through the documentation I can see I can start and name a profile via python but there doesn't seem to be a method for retrieving a profile by name or id in a later script node.
hello, I experienced the same issue and Support from SideFX was of great help,
I quote their advice, but I don't know if it can be implemented with TOPs (can you use the hou.session in Top?)

Note: "START_" and "END_" are 2 python sop nodes the wraps the network block I wanted to profile.

In the "START_perf_profile" node, you could do:
node = hou.pwd()
iteration = node.evalParm("iteration")

if not hasattr(hou.session, "profiles"):
hou.session.profiles = {}

profile = hou.perfMon.startProfile("profile for iteration " + str(iteration))
hou.session.profiles[] = profile

And in the "END_perf_profile" node, you could do:

node = hou.pwd()
id = node.evalParm("get_id")
profile = hou.session.profiles[id]

In the future, we probably should add a new `hou.perfMon.getProfile(id)` to HOM but we'll need to do an investigation first. I vaguely recall that we chose not to add such a function but I can't recall exactly why.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB