Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mesurer (par)tout, tout le temps
Search
Timothée Peignier
September 16, 2012
Programming
2
580
Mesurer (par)tout, tout le temps
Timothée Peignier
September 16, 2012
Tweet
Share
More Decks by Timothée Peignier
See All by Timothée Peignier
Dr. Rubocop
tim
0
140
Et votre backoffice ?
tim
0
250
Mobile Web Performance
tim
1
300
Un site web mobile en Django
tim
1
410
Other Decks in Programming
See All in Programming
CSC307 Lecture 05
javiergs
PRO
0
210
生成AIをkintoneに連携してみた
hideg
0
230
入社1ヶ月でここまでやった!Findy Toolsインフラ支援の最適化
rvirus0817
6
1.4k
Introduction of Happy Eyeballs Version 2 (RFC8305) to the Socket library
coe401_
1
220
CSC307 Lecture 14
javiergs
PRO
0
220
CSC307 Lecture 13
javiergs
PRO
0
150
Namespace on read
tagomoris
2
370
Temporalを取り巻く仕様を整理する
sajikix
0
110
君たちはどうコードをレビューする (される) か / 大吉祥寺.pm
utgwkk
15
8.5k
CSC307 Lecture 09
javiergs
PRO
1
500
SDCon2024: Enabling DevOps and Team Topologies thru architecture: architecting for fast flow
cer
PRO
0
780
CSC307 Lecture 07
javiergs
PRO
0
220
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
652
58k
What's new in Ruby 2.0
geeforr
338
31k
Speed Design
sergeychernyshev
9
270
Fireside Chat
paigeccino
25
2.8k
Raft: Consensus for Rubyists
vanstee
134
6.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
16
1.6k
Building a Scalable Design System with Sketch
lauravandoore
458
32k
How to Think Like a Performance Engineer
csswizardry
4
590
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
149
45k
Building an army of robots
kneath
301
42k
Scaling GitHub
holman
458
140k
Pencils Down: Stop Designing & Start Developing
hursman
118
11k
Transcript
Mesurer (par)tout, tout le temps
Nous écrivons du code.
Notre travail est de générer de la valeur.
Notre code est un sous-produit.
Notre code génère de la valeur quand il est exécuté,
pas quand nous l’écrivons.
Que fait notre code quand il s’exécute ?
Mesurer.
Notre code ne se comporte pas comme nous le pensons.
None
“Ce code ne peut pas échouer”
(et pourtant il échoue) “Ce code ne peut pas échouer”
“Ce code ne peut pas fonctionner”
(et pourtant il fonctionne) “Ce code ne peut pas fonctionner”
Cela affecte nos décisions.
def sort(obj_list): time.sleep(10) obj_list.sort() def sort(obj_list): obj_list.sort() Lequel est le
plus rapide ? ❶ ❷
def sleep(): # I’m poison pass
def sort(self): # I’m evil raise RuntimeError
Mesurez-le, vous le saurez.
Moins de confusion, de meilleures décisions.
Mesurer, continuellement, en production.
Et python dans tout ça ?
pip installwhisper carbon graphite-web statsd metrology
librato newrelic ( )
Gauges Counters Meters Histograms Timers
Gauges Il y a n workers actifs
statsd.gauge(“workers”, state.workers_count)
Gauges Counters Meters Histograms Timers
Counters Il y a n jobs en attente
counter = Metrology.counter('pending') counter.increment() counter.decrement()
Gauges Counters Meters Histograms Timers
Meters Il y a n requêtes/s
meter = Metrology.meter('requests') meter.mark()
Gauges Counters Meters Histograms Timers
Histograms La taille de la réponse
histogram = Metrology.histogram('response-sizes') histogram.update(len(response.content))
Gauges Counters Meters Histograms Timers
Timers Temps de réponse
timer = Metrology.timer('responses') with timer: make_response()
Collecter, Agréger, Monitorer.
Données historiques + Déploiements + Pannes + Comportement en charge
None
None
None
None
Votre vision de votre code sera plus proche de la
réalité.
Merci beaucoup ! @cyberdelia lanyrd.com/sxqqf (ne soyez pas timide, posez
votre question)