[QGIS-Developer] Profiler times in Python

Michel Stuyts michel.stuyts at edegem.be
Fri May 5 01:21:17 PDT 2023


I want to use the data on plugins from the Profiler.  In the "Debugging/Development Tools" Panel I can see both the total time for all plugins and the individual time per plugin.  With the following Python code, I want to get the same data in Python:

profiler = QgsApplication.profiler()
for child in profiler.childGroups():
    childGroup = profiler.childGroups(child)
    if child == 'Load plugins':
        print(child, profiler.profileTime(child))
        for subGroup in childGroup:
            print(subGroup, profiler.profileTime(subGroup))

It shows the total time for all plugins just fine as "Load plugins" with the same number of seconds as in the Panel, but for the individual plugins I get 0.0 as time for all plugins.  What do I do wrong or is it a bug?


Michel Stuyts
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20230505/1d03c6d9/attachment.htm>


More information about the QGIS-Developer mailing list