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
690
2
Share
Mesurer (par)tout, tout le temps
Timothée Peignier
September 16, 2012
More Decks by Timothée Peignier
See All by Timothée Peignier
Dr. Rubocop
tim
0
200
Et votre backoffice ?
tim
0
280
Mobile Web Performance
tim
1
340
Un site web mobile en Django
tim
1
450
Other Decks in Programming
See All in Programming
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
1.6k
Technical Debt: Understanding it Rightly, Engaging it Rightly #LaravelLiveJP
shogogg
0
160
Claspは野良GASの夢をみるか
takter00
0
130
自動レビューエンジンの実装と運用 ~レビューのない世界へ~
kurukuru1999
2
280
Skillは並べた。動かなかった。契約で繋いだ。— 65個のSkillから、自走する開発サイクルへ
junholee
0
780
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
320
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
140
Oxcを導入して開発体験が向上した話
yug1224
4
240
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
380
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
390
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
1.2k
AI 時代のソフトウェア設計の学び方
masuda220
PRO
28
11k
Featured
See All Featured
Done Done
chrislema
186
16k
Scaling GitHub
holman
464
140k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
240
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
350
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.2k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
How to Think Like a Performance Engineer
csswizardry
28
2.6k
The Spectacular Lies of Maps
axbom
PRO
1
770
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
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)