#7977 Improvements to AlluraTimerMiddleware

unreleased
open
nobody
bitesize (76)
General
nobody
2019-02-08
2015-08-25
No

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.

Related

Tickets: #7977

Discussion

  • Dave Brondsema

    Dave Brondsema - 2016-03-17
    • labels: --> bitesize
     
  • Noumbissi Valere

    @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.

     
  • Dave Brondsema

    Dave Brondsema - 2019-02-05

    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.

     
  • Noumbissi Valere

    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]

     
  • Dave Brondsema

    Dave Brondsema - 2019-02-08

    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, the def 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.

     
    • Noumbissi Valere

      Ok thanks. will look into that

      On Fri, Feb 8, 2019 at 4:21 PM Dave Brondsema dave@brondsema.net wrote:

      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, the def 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.


      Status: open
      Milestone: unreleased
      Labels: bitesize
      Created: Tue Aug 25, 2015 09:30 PM UTC by Dave Brondsema
      Last Updated: Thu Feb 07, 2019 09:13 AM UTC
      Owner: nobody

      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.


      Sent from forge-allura.apache.org because dev@allura.apache.org is
      subscribed to https://forge-allura.apache.org/p/allura/tickets/

      To unsubscribe from further messages, a project admin can change settings
      at https://forge-allura.apache.org/p/allura/admin/tickets/options. Or, if
      this is a mailing list, you can unsubscribe from the mailing list.

       

      Related

      Tickets: #7977


Log in to post a comment.