devoxx france 2014 - tests de performance en continu

21
@ XebiaFR #DevoxxFR2014 Tests de perf en continu @willymontaz, @guillarnaud Xebia, blog.xebia.fr William Montaz, Guillaume Arnaud

Upload: xebia-france

Post on 11-May-2015

1.348 views

Category:

Presentations & Public Speaking


3 download

TRANSCRIPT

Page 1: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

Tests de perf en continu

@willymontaz, @guillarnaud Xebia, blog.xebia.fr William Montaz, Guillaume Arnaud

Page 2: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

Plan

contexte méthodologie

outils GO!

Page 3: Devoxx France 2014 - Tests de performance en continu

@YourTwitterHandle#DVXFR14{session hashtag} @DevoxxFR#DevoxxFR2014

Cont

exte

Page 4: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

Anticiper

Multithreadingdead lock isolation

Contention taille de pool sollicitation BDD

Système mémoire cpu

DevOps déploiement continu dimensionnement

Page 5: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

Loi de Little

L = λ.𝝉

L = nombre de requêtes λ = fréquence 𝝉 = durée moyen des requêtes

Page 6: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

Loi de Little

serveur d’application

1 requête/sec200 ms

5 requêtes

Page 7: Devoxx France 2014 - Tests de performance en continu

@YourTwitterHandle#DVXFR14{session hashtag} @DevoxxFR#DevoxxFR2014

Métho

-

dolog

ie

Page 8: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

Que teste-t-on ?

test de perf != test de charge

non exhaustif

temps de référence

reproductabilité

Page 9: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

Ecrire un scénario

dialogue simple

un service = un job

débit fixe

contrôle des réponses

données déterministes

Page 10: Devoxx France 2014 - Tests de performance en continu

@YourTwitterHandle#DVXFR14{session hashtag} @DevoxxFR#DevoxxFR2014

Outils

Page 11: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

serveur d’intégration continu

serveur de monitoring

Environnement technique

serveur d’application

Diamond

graphite

déploie

ordonne tire

récolte

alimente

alimente

alimente

récolte

Page 12: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

Gatling!

• Domain Specific Language (DSL) intuitive

• s’intègre bien avec Jenkins et Maven

• hype: scala, modèle actor

• peut être étendu

orienté développeur

Page 13: Devoxx France 2014 - Tests de performance en continu

@YourTwitterHandle#YourSessionHashtag

val scn = scenario("My scenario") .exec(http("My Page") .get("http://mywebsite.com/page.html") .param("username", "bill") .check(status.is(200))) !setUp(scn.inject( constantRate(20 usersPerSec) during (15 seconds) ))

Gatling: DSL

http://gatling-tool.org/

Page 14: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

Gatling

Page 15: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

Graphite

https://graphite.readthedocs.org/en/1.0/url-api.html

Page 16: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

Graphitewildcard target=server*.cpu

timeshift target=server1.cpu&from=-30min&until=-10min target=server1.cpu&target=timeShift(server1.cpu, "7d")

operations target=sumSeries(server*.cpu, "7d") target=derivative(gatling.hitcount)

format de sortie target=server1.cpu&format=json

graphique target=server*.cpu&bgcolor=blue&aeraMode=stacked

Page 17: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

Grafana

http://grafana.org/

Page 18: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

JMXTrans{"servers" : [ { "port" : "8004", "host" : "mysys.mydomain", "queries" : [ { "outputWriters" : [ { "@class" : "com.g.j.m.output.GraphiteWriter", "settings" : {"port" : 2003,"host" : "myhost", "typeNames" : [ "name" ]} } ], "obj" : "Catalina:type=…,class=j.s.DataSource,name=*", "resultAlias": "datasources", "attr" : [ "numActive", "numIdle" ] } ], "numQueryThreads" : 2 } ] }

http://www.jmxtrans.org/

Page 19: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

Diamond

https://github.com/BrightcoveOS/Diamond

Page 20: Devoxx France 2014 - Tests de performance en continu

@XebiaFR#DevoxxFR2014

Metrics

public class QueueManager { private final Queue queue; ! public QueueManager(MetricRegistry metrics, String name) { this.queue = new Queue(); metrics.register(MetricRegistry.name(QueueManager.class, name, "size"), new Gauge<Integer>() { @Override public Integer getValue() { return queue.size(); } }); } }

http://metrics.codahale.com/

Page 21: Devoxx France 2014 - Tests de performance en continu

@YourTwitterHandle@YourTwitterHandle#YourSessionHashtag

GO!