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
660
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
170
Et votre backoffice ?
tim
0
260
Mobile Web Performance
tim
1
310
Un site web mobile en Django
tim
1
430
Other Decks in Programming
See All in Programming
NIKKEI Tech Talk#38
cipepser
0
230
ソフトウェア設計の実践的な考え方
masuda220
PRO
4
660
マンガアプリViewerの大画面対応を考える
kk__777
0
260
他言語経験者が Golangci-lint を最初のコーディングメンターにした話 / How Golangci-lint Became My First Coding Mentor: A Story from a Polyglot Programmer
uma31
0
420
エンジニアインターン「Treasure」とHonoの2年、そして未来へ / Our Journey with Hono Two Years at Treasure and Beyond
carta_engineering
0
430
React Nativeならぬ"Vue Native"が実現するかも?_新世代マルチプラットフォーム開発フレームワークのLynxとLynxのVue.js対応を追ってみよう_Vue Lynx
yut0naga1_fa
2
1k
「ちょっと古いから」って避けてた技術書、今だからこそ読もう
mottyzzz
12
7.2k
Six and a half ridiculous things to do with Quarkus
hollycummins
0
210
Developer Joy - The New Paradigm
hollycummins
1
370
Claude Agent SDK を使ってみよう
hyshu
0
1.4k
なぜGoのジェネリクスはこの形なのか? - Featherweight Goが明かす設計の核心
qualiarts
0
250
オープンソースソフトウェアへの解像度🔬
utam0k
17
3.1k
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
658
61k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Side Projects
sachag
455
43k
Context Engineering - Making Every Token Count
addyosmani
8
300
Unsuck your backbone
ammeep
671
58k
What's in a price? How to price your products and services
michaelherold
246
12k
Automating Front-end Workflow
addyosmani
1371
200k
Writing Fast Ruby
sferik
630
62k
Six Lessons from altMBA
skipperchong
29
4k
Typedesign – Prime Four
hannesfritz
42
2.8k
The World Runs on Bad Software
bkeepers
PRO
72
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)