AGENDA
•
Why should I care about metrics?
•
General principles when collecting metrics
•
How we measure our things @ Xerpa
•
Demo demo demo
Slide 8
Slide 8 text
DISCLAIMER
•
The main inspiration for this talk is Coda Hale's
“Metrics Metrics” talk:
•
https://www.youtube.com/watch?v=czes-oa0yik
Slide 9
Slide 9 text
WHY SHOULD I CARE ABOUT METRICS?
Slide 10
Slide 10 text
WHY?
•
We write code.
Slide 11
Slide 11 text
WHY?
•
We write code.
•
Code generates business value.
Slide 12
Slide 12 text
WHY?
•
We write code.
•
Code generates business value.
– When we RUN it is running.
– Not when we write it.
Slide 13
Slide 13 text
WHY?
•
In order to generate more business value,
we need to make better decisions about our code.
Slide 14
Slide 14 text
WHY?
•
In order to generate more business value,
we need to make better decisions about our code.
•
In order to make better decisions about our code
(about anything really) we need to measure it.
Slide 15
Slide 15 text
THE MAP IS NOT THE TERRITORY
Slide 16
Slide 16 text
WHY?
•
We have a mental model of what our code does.
Slide 17
Slide 17 text
WHY?
•
We have a mental model of what our code does.
•
We are often wrong
Slide 18
Slide 18 text
WHY?
•
We have a mental model of what our code does.
•
We are often wrong
•
There is no physical counterpart for the things we work
with. We spend too much times inside our heads.
Slide 19
Slide 19 text
WHICH IS FASTER?
Slide 20
Slide 20 text
WE DON'T KNOW
Slide 21
Slide 21 text
WHY?
Slide 22
Slide 22 text
WHY?
Slide 23
Slide 23 text
WHY?
•
If we we're so wrong in such a trivial example, imagine
a typical web-app scenario:
Slide 24
Slide 24 text
WHY?
•
If we we're so wrong in such a trivial example, imagine
a typical web-app scenario:
– Action routing
– Database queries
– Template rendering
– Session cache
Slide 25
Slide 25 text
WHY?
•
If we we're so wrong in such a trivial example, imagine
a typical web-app scenario:
– Action routing (10ms)
– Database queries (31ms)
– Template rendering (22ms)
– Session cache (327ms)
Slide 26
Slide 26 text
WE DON'T KNOW
Slide 27
Slide 27 text
WE DON'T KNOW
UNTIL WE SEE OUR CODE FOR WHAT IT
**ACTUALLY** DOES (SCIENCE!!)
Slide 28
Slide 28 text
METRICS METRICS METRICS
Slide 29
Slide 29 text
TYPES OF MEASUREMENTS
– Counters
– Gauges
– Histograms
– Timers
(See coda-hales “metrics, metrics” talk!)
Slide 30
Slide 30 text
TYPES OF MEASUREMENTS
Slide 31
Slide 31 text
HOW WE MEASURE THINGS @ XERPA
Slide 32
Slide 32 text
•
Slide 33
Slide 33 text
•
Slide 34
Slide 34 text
•
Slide 35
Slide 35 text
•
ESTAMOS
CONTRATANDO
Slide 36
Slide 36 text
•
ESTAMOS
CONTRATANDO
(principalmente se vc manjar frontend)
Slide 37
Slide 37 text
•
ESTAMOS
CONTRATANDO
(principalmente se vc manjar frontend,
mas também rola backend)
Slide 38
Slide 38 text
•
Slide 39
Slide 39 text
•
•
•
SQL-like query language
•
HTTP interface
•
Continuous Queries
•
Seamless integration with Grafana
•
(has an exometer reporter)
Slide 40
Slide 40 text
•
•
<<<<<<<< LIVE DEMO >>>>>>>>>
•
https://github.com/rranelli/elugsp_milmetrics
Slide 41
Slide 41 text
•
mix.exs
Slide 42
Slide 42 text
•
config.exs
Slide 43
Slide 43 text
•
plug/metrics.exs
Slide 44
Slide 44 text
•
Start `grafana` and `influxdb` with `make start`
•
Configure a new data source for influxdb 0.9x, user:
root, pass: root, host: http://localhost:8086
•
Profit