41
Performance is Happiness

Expo qa 2016

Embed Size (px)

Citation preview

Page 1: Expo qa 2016

Performance is Happiness

Page 2: Expo qa 2016

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)

Page 3: Expo qa 2016

Performance Team

Page 4: Expo qa 2016

• User Satisfaction• What to Measure• How to Measure• What to Monitor

What are we going to focus on?

Page 5: Expo qa 2016
Page 6: Expo qa 2016

Fear the Latency

Page 7: Expo qa 2016

Fear the Latency

Page 8: Expo qa 2016

Fear is the path to the dark side. Fear leads to Inertia. Inertia Leads to paralysis. Paralysis leads to going out of Business.

Page 9: Expo qa 2016

Let’s Aim for Speed

Page 10: Expo qa 2016
Page 11: Expo qa 2016

What shall we Measure?

Page 12: Expo qa 2016
Page 13: Expo qa 2016
Page 14: Expo qa 2016

Vista WaterfallUna vez ejecutado veremos

Sin Cache de BrowserCon Cache de Browser

Golden Performance Rules

Page 15: Expo qa 2016

Time is Relative

Page 16: Expo qa 2016

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?

Page 17: Expo qa 2016

Size?

Page 18: Expo qa 2016

What shall we Measure?

Page 19: Expo qa 2016

Number of Requests?

Page 20: Expo qa 2016
Page 21: Expo qa 2016

Number of Domains?

Page 22: Expo qa 2016

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.

Page 23: Expo qa 2016
Page 24: Expo qa 2016

“My Mean time is fine."

Page 25: Expo qa 2016

Apdex Index

t = acceptable response timesatisfied = response time < t

tolerating = t < response time > 4tfrustrated = response time > 4t

Apdex [t] = (satisfied + tolerating/2)/total requests

Page 26: Expo qa 2016

Afterwards … in PROD ...

Page 27: Expo qa 2016

Time To FIRST BYTE

Page 28: Expo qa 2016
Page 29: Expo qa 2016
Page 30: Expo qa 2016

Waterfall Detalles

Page 31: Expo qa 2016

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é

Page 32: Expo qa 2016

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 ...

Page 33: Expo qa 2016

PerformanceIt's not just about adding more

servers

Page 34: Expo qa 2016
Page 35: Expo qa 2016

REAL USER MONITORING

Bring Up RUM*

real user monitoring

Page 36: Expo qa 2016
Page 37: Expo qa 2016

Real User Monitoring

Page 38: Expo qa 2016
Page 39: Expo qa 2016
Page 40: Expo qa 2016

THINK BIG

Page 41: Expo qa 2016