It'd be useful to have AlluraTimerMiddleware wrap the project nav logic. This would help identify any issues related to that (e.g. project with tons of tools)
And the first "ming" timer should be renamed "ming-iter" so that the high call counts it produces is separate from the regular ming counts.
@Dave am interested in this problem. am new to open source. please can you give me a hint on how to solve this issue? Thanks.
Hi,
AlluraTimerMiddleware
is a class in allura, so first step would be to find that and see how it declares various timers around different functions & methods. That class uses a separate python library https://pythonhosted.org/TimerMiddleware/ so you can look at the docs there too to learn about it more.You can see the output / results of AlluraTimerMiddleware in the
stats.log
file that it creates.I was able learn about the TimerMiddleware and i equally found the AlluraTimerMiddleware class, it is found in allura/lib/custom_middleware.py. I equally used the allura web interface and saw some logs in generated in the stats.log file.
I saw how they add the sidebar logic to the timer as follows:
[Timer('sidebar', ep.load(), 'sidebar_menu') for ep in tool_entry_points]
can i do same for the nav logic? that is
[Timer('navbar', ep.load(), 'navbar_menu') for ep in tool_entry_points]
Did you try it? The first paramater to
Timer
is a name so that can be whatever. The 2nd and 3rd parameters specify what object/method(s) to time. For the sidebar, thedef sidebar_menu
method exists on every tool, which is why its looping to get them all. But for navbar I think it can be simpler like the other timers. You will have to explore the codebase to find the right top project nav method, and then make the Timer measure that method.Ok thanks. will look into that
On Fri, Feb 8, 2019 at 4:21 PM Dave Brondsema dave@brondsema.net wrote:
Related
Tickets: #7977