Show page render time on events list
This commit is contained in:
parent
11bc0419b3
commit
15c5053e44
|
@ -150,6 +150,7 @@
|
|||
{% for name, seconds in timings %}
|
||||
<li>{{ name }} took {{ "%.1f" | format(seconds) }} seconds</li>
|
||||
{% endfor %}
|
||||
<li>Render time: {{ "%.1f" | format(render_time) }} seconds</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -7,6 +7,7 @@ import inspect
|
|||
import operator
|
||||
import os.path
|
||||
import sys
|
||||
import time
|
||||
import traceback
|
||||
from collections import defaultdict
|
||||
from datetime import date, datetime, timedelta
|
||||
|
@ -70,6 +71,7 @@ def exception_handler(e: werkzeug.exceptions.InternalServerError) -> tuple[str,
|
|||
@app.route("/")
|
||||
async def index() -> str:
|
||||
"""Index page."""
|
||||
t0 = time.time()
|
||||
now = datetime.now()
|
||||
data = await agenda.data.get_data(now, app.config)
|
||||
|
||||
|
@ -88,6 +90,7 @@ async def index() -> str:
|
|||
fullcalendar_events=calendar.build_events(events),
|
||||
start_event_list=date.today() - timedelta(days=1),
|
||||
end_event_list=date.today() + timedelta(days=365 * 2),
|
||||
render_time=(time.time() - t0),
|
||||
**data,
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue