Knowing is Half the Battle

or Making Decisions with Data

You Know What They Say About Assumptions…

But we make them all the time.

Not That Big a Deal

Except When it Is

Story Time…

So What Can We Do?

Start measuring things. Prove that you’re right.

And now two new tools: StatsD and Graphite

What? Why?

So, What?

StatsD

TL;DR

What Kinds of Metrics?

Counts / Incrementers

gorets:1|c

Metrics.record_counter("gorets")

Timings

glork:320|ms

Metrics.record_timer("glork") { do_thing }

Guages (Arbitrary Numbers)

Not yet implemented in our wrapper. Haven’t needed it yet.

Higher Abstractions

Booleans

Metrics.record_boolean("key", value?)

Cache Usage

Metrics.record_boolean("page-show")

Metrics.record_cache_miss("page-show")

Object Creation

Metrics.record_creation("user")

Graphite

TL;DR

See What I Mean?

legendValue(aliasByNode(limit( sortByMaxima(summarize( stats_counts.ngin_production.api-user-throughput.*:sum,"60seconds")),6),3), "total")

Enough Already, What Does it All MEAN?

Examples

Examples

No, What Does it Mean For ME??

Who is Using our API?

Metrics.record_counter("api-user-throughput.#{@api_user.try(:user_name) || 'nil_api_user'}")

How Many Users are Logged In?

Metrics.record_boolean('user-logged-in', user_object.persisted?)

Are We Using Page#show Action Caching?

caches_action :show, :if => lambda {|c| Metrics.record_boolean("page-cache", c.cache_page?(c.page_node)) }

What Do You Want to Know?

Questions?

Resources