devoxx france 2014 - tests de performance en continu
TRANSCRIPT
@XebiaFR#DevoxxFR2014
Tests de perf en continu
@willymontaz, @guillarnaud Xebia, blog.xebia.fr William Montaz, Guillaume Arnaud
@XebiaFR#DevoxxFR2014
Plan
contexte méthodologie
outils GO!
@YourTwitterHandle#DVXFR14{session hashtag} @DevoxxFR#DevoxxFR2014
Cont
exte
@XebiaFR#DevoxxFR2014
Anticiper
Multithreadingdead lock isolation
Contention taille de pool sollicitation BDD
Système mémoire cpu
DevOps déploiement continu dimensionnement
@XebiaFR#DevoxxFR2014
Loi de Little
L = λ.𝝉
L = nombre de requêtes λ = fréquence 𝝉 = durée moyen des requêtes
@XebiaFR#DevoxxFR2014
Loi de Little
serveur d’application
1 requête/sec200 ms
5 requêtes
@YourTwitterHandle#DVXFR14{session hashtag} @DevoxxFR#DevoxxFR2014
Métho
-
dolog
ie
@XebiaFR#DevoxxFR2014
Que teste-t-on ?
test de perf != test de charge
non exhaustif
temps de référence
reproductabilité
@XebiaFR#DevoxxFR2014
Ecrire un scénario
dialogue simple
un service = un job
débit fixe
contrôle des réponses
données déterministes
@YourTwitterHandle#DVXFR14{session hashtag} @DevoxxFR#DevoxxFR2014
Outils
@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
@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
@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/
@XebiaFR#DevoxxFR2014
Gatling
@XebiaFR#DevoxxFR2014
Graphite
https://graphite.readthedocs.org/en/1.0/url-api.html
@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
@XebiaFR#DevoxxFR2014
Grafana
http://grafana.org/
@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/
@XebiaFR#DevoxxFR2014
Diamond
https://github.com/BrightcoveOS/Diamond
@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/
@YourTwitterHandle@YourTwitterHandle#YourSessionHashtag
GO!