Roundup Tracker - Issues

Message6920

Author rouilj
Recipients rouilj, techtonik
Date 2020-06-02.14:54:47
Message-id <20200602145442.E72DF4C0491@itserver6.cs.umb.edu>
In-reply-to <CAPkN8xJTHHJoqPM-kiyGMH3S5m+oMfZ38kDP6aTovHwoYc4CZQ@mail.gmail.com>
Hi Anatoly:

In message <CAPkN8xJTHHJoqPM-kiyGMH3S5m+oMfZ38kDP6aTovHwoYc4CZQ@mail.gmail.com>
,
anatoly techtonik writes:
>My biggest grief is RoundUp router and Jinja2 engine. )

The jinja2 stuff has some updates thanks to Christof. I think
it's more secure by default now and there have been some page
additions as well.

>While it is nice to see what kind of information is available, it is still
>not visible in the footer
>of https://issues.roundup-tracker.org/ and I don't see any stats at all.

We could add the python and roundup versions. Both of those can be
made available by a simple extension and a corresponding template
change. For the record: Roundup version: 1.6.1, Python Version: 2.7.12.

But why would we want to spam people with performance stat info? It's kind
of meaningless unless you know the roundup code.

Also it's not RUM. I have some RUM like stats installed in my page
templates to get info like load/render time.

>MySQL XXX, SQL Queries: XXX, Request Time: XXXsec.

The references to CGI_SHOW_TIMINGS are in roundup/cgi/client.py
Client::renderContext. Did you investigate how they put in Cache
hits/misses, timings etc? Also it looks like it may just generate
hyperdb level stats. I am not sure how far down the stack the stats
generation is done, so you may not have your mysql/postgresql database
stats.

>I guess the Python code that does HTML formatting is needed to be
>itself template independent, but I'd prefer the function to return
>JSON so that web interface part could format it to their liking.

So you want an output format like:

 <script nonce="random_nonce">
 timing_stats = { 'filtering': 2.3, 'elapsed': 3.2, ...}
 </script>

Is that right?

The way the stats are currently added is to replace the </body> tag
when rendering the page. Currently there are two formats for rendering
the stats. One is as a paragraph and one is as a comment. You could
add a third to render as a script in json form when the environment
variable is set to JSON.

The problem with getting these into the template is that the timing
stats are generated just before the html file is returned. It has to
be this way since the template rendering needs to be included in the
stats. So it can't be rendered inside the tal/jinja2/chameleon engine.

As I note these stats are hyperdb and overall rendering info. It could
be possible to link self.db['stats'] into the request object as
request/db/stats. This would be a snapshot at the time, but if you
accessed it only at the end of the template, you would have all the
stats except for the overall time. You might be able to calculate that
from the client.start time.

This also brings up an interesting point, the JSON endpoint doesn't
have a method for generating or returning stats to the caller.

Have a great day.
History
Date User Action Args
2020-06-02 14:54:48rouiljsetrecipients: + techtonik
2020-06-02 14:54:48rouiljlinkissue2550736 messages
2020-06-02 14:54:48rouiljcreate