Hi!

Interesting. Basically you want to time how long does it take for
response.render(...).

Easiest way would be to use a decorator:
- your function returns dict(data=data)
- you decorate it, call response.render(response.view, return_dict) and
time it
- return the result (it will be a string so it will bypass web2py's magic
with dicts)

Next step would be to decorate the functions automatically (without using
decorators ^_^). You can monkeypatch response._caller(...). It takes a
function to be called [if you have def index():, it will be called as
response._caller(index)].
This way you can also time execution of the function, not just the view
rendering :). You don't change anything inside web2py code. You can just
disable it in production.
Btw, I didn't try it, but it should work.
Note that in web2py you can do whatever you want in views (including db
queries) so it's not just rendering.

Marin

On Thu, Sep 18, 2014 at 7:56 AM, Encompass solutions <[email protected]>
wrote:

> Yes, this is something that should only be used in a local setup.  It's to
> help development.  If there are ways to stop this from showing up
> accidently anyway, I fully intend on using it.
> As for the page load time feature, that was for the loading of the
> document from the browsers perspective.  I hope to avoid that one, I think
> some timing for how long it took python to render the page would be more
> appropriate.  Let's see if I can figure that out. :/
> Here is my update of the UI in video format. Please, anyone, comment.
> BR,
> Jason Brower
>
>
>
> On Thursday, September 18, 2014 6:24:40 AM UTC+3, Massimo Di Pierro wrote:
>>
>> You would have to pass that information but mind that they may contain
>> data that is sensitive and private.
>>
>> globals() contains all the global variables. db._timings is a list of
>> (SQL, time) for all the queries. For the loading time look into window
>> performance client-side: http://stackoverflow.com/questions/
>> 13045767/page-load-time-with-javascript
>>
>>
>> On Tuesday, 16 September 2014 14:28:16 UTC-5, Encompass solutions wrote:
>>>
>>>
>>> I am working on a feature for web2py and would like to gather the
>>> following information:
>>>
>>>    - How long did it take to render html for the page.
>>>    - What database calls occured with this page render.
>>>    - What were the calls that were made in SQL and DAL format.
>>>    - What Global variables are set in the model.
>>>
>>> The idea I am working on is a bar that would render if locally run, or
>>> requested, that would display information about content sent to the page.
>>> Like the generic page but a little more informative and able to pulled up
>>> without interfering with the page at all.
>>>
>>> How would I get what I have stated above?
>>>
>>> Is there other content you would want for this DevBar, as I call it?  I
>>> don't want to try to make my own firebug or anything, just stuff
>>> specifically about web2py's and the things that might be needed in making
>>> sure the page loads properly and developed quickly.
>>>
>>> Attached are my beginnings of it.  It would pull out from the left with
>>> an html widget in the top right.  Then selecting a tab on the right would
>>> load content on the left with the original page in the background.
>>>
>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to