Upload
almudena-vivanco
View
165
Download
0
Embed Size (px)
Citation preview
Performance is Happiness
import randomimport timeimport requests
class Speaker(object):
def __init__(self): born = "Avilés - Asturias" studies = "Applied Maths and Computability" jobdescription = "Performance Jedi" company = "Telefónica I+D" team = "Product Engineering" project = "AWAZZA" talks = [VLC Testing, DevopsDays, WebPerfDays, Velocity]
def talk(self): start_timer = time.time() r = requests.get('http://www.slideshare.net/almudenavivanco') r.raw.read() latency = time.time() - start_timer self.custom_timers[‘ExpoQA’'] = latency
if __name__ == '__main__': speech = Speaker() speech.talk() print trans.custom_timers
Almudena Vivanco (@MrsDaehin)
Performance Team
• User Satisfaction• What to Measure• How to Measure• What to Monitor
What are we going to focus on?
Fear the Latency
Fear the Latency
Fear is the path to the dark side. Fear leads to Inertia. Inertia Leads to paralysis. Paralysis leads to going out of Business.
Let’s Aim for Speed
What shall we Measure?
Vista WaterfallUna vez ejecutado veremos
Sin Cache de BrowserCon Cache de Browser
Golden Performance Rules
Time is Relative
Analytical Review ParametersLocalizaciónBrowserVelocidad de ConexiónNúmero de test a ejecutar ( coger un número Impar ;) )First View and Repeat View ( Cache!!! )Document Complete vs OnLoadIgnorar Errores SSL Capturar tcpdumpUser Agent ad HocCustom Headers
What shall we Measure?
Size?
What shall we Measure?
Number of Requests?
Number of Domains?
SPOF y BlockLa opción de Block nos simula un error tipo 404 mientras que si usamos el SPOF nos simula un timeout.
Por ejemplo podemos comprobar con Block la diferencia entre el tiempo de carga con y sin anuncios ( bloqueando
anuncios o trackers ;) )
En cambio cuando probamos el Single Point of Failure lo que queremos comprobar es que nuestro site es resilient a
3rd parties como por ejemplo los trackers, cómo se comporta nuestro site si el acceso a google analytics es lento o
realmente no hay servicio.
“My Mean time is fine."
Apdex Index
t = acceptable response timesatisfied = response time < t
tolerating = t < response time > 4tfrustrated = response time > 4t
Apdex [t] = (satisfied + tolerating/2)/total requests
Afterwards … in PROD ...
Time To FIRST BYTE
Waterfall Detalles
Cómo analizar el waterfallCuántos Kb tiene el html inicialEn qué segundo comienza el evento render
Cuántos socket connections hay hacia un host en concreto
Cuántas redireccionesEn qué momento hay un socket abierto contra un recurso y por qué
Custom Metrics[iframe-count]return document.getElementsByTagName("iframe").length;
[script-tag-count]return document.getElementsByTagName("script").length;
[meta-viewport]var viewport = undefined;var metaTags=document.getElementsByTagName("meta");for (var i = 0; i < metaTags.length; i++) { if (metaTags[i].getAttribute("name") == "viewport") { viewport = metaTags[i].getAttribute("content"); break; }}return viewport
NO se pueden añadir operaciones asincronas :( Timers, Ajax requests etc ...
PerformanceIt's not just about adding more
servers
REAL USER MONITORING
Bring Up RUM*
real user monitoring
Real User Monitoring
THINK BIG