HTTP Server-Timing

One of the easiest way to visualize your app internal performance metrics on demand is too use pretty new standard described in:

https://www.w3.org/TR/server-timing/

combined it with for example Chrome Developers Tools from version 65. More practically with Python Flask app:

#!/usr/bin/python

from flask import Flask,request,make_response

app = Flask(__name__)

@app.route("/")
def index():
    response = make_response()
    if request.cookies.get('profiler'):
        response.headers['Server-Timing'] = 'task1;desc="Task 1";dur=1500,'+\
                                            'task2;desc="Task 2";dur=110.5'
    return response

and here is the result:

servertiming

comments powered by Disqus

powered by Hugo and Noteworthy theme