Class Cabin::Metrics
In: lib/cabin/namespace.rb
lib/cabin/metrics.rb
lib/cabin/namespace.rb
lib/cabin/metrics.rb
Parent: Object

What type of metrics do we want?

What metrics should come by default? Per-call/transaction/request metrics like:

  - hit (count++ type metrics)
  - latencies/timings

Per app or generally long-lifetime metrics like:

  - "uptime"
  - cpu usage
  - memory usage
  - count of active/in-flight actions/requests/calls/transactions
  - peer metrics (number of cluster members, etc)

github.com/codahale/metrics/tree/master/metrics-core/src/main/java/com/yammer/metrics/core Reading what Coda Hale‘s "Metrics" stuff has, here‘s my summary:

  gauges (callback to return a number)
  counters (.inc and .dec methods)
  meters (.mark to track each 'hit')
    Also exposes 1, 5, 15 minute moving averages
  histograms: (.update(value) to record a new value)
    like meter, but takes values more than simply '1'
    as a result, exposes percentiles, median, etc.
  timers
    a time-observing interface on top of histogram.

With the exception of gauges, all the other metrics are all active/pushed. Gauges take callbacks, so their values are pulled, not pushed. The active metrics can be represented as events since they the update occurs at the time of the change.

These active/push metrics can therefore be considered events.

All metrics (active/passive) can be queried for ‘current state’, too, making this suitable for serving to interested parties like monitoring and management tools.

Methods

counter   counter   each   each   histogram   histogram   meter   meter   new   new   timer   timer  

Included Modules

Enumerable Cabin::Publisher Enumerable Cabin::Publisher

Classes and Modules

Class Cabin::Metrics::Counter
Class Cabin::Metrics::Gauge
Class Cabin::Metrics::Histogram
Class Cabin::Metrics::Meter
Class Cabin::Metrics::Timer

Public Class methods

Get us a new metrics container.

Get us a new metrics container.

Public Instance methods

Create a new Counter metric ‘instance’ is usually an object owning this metric, but it can be a string. ‘name’ is the name of the metric.

Create a new Counter metric ‘instance’ is usually an object owning this metric, but it can be a string. ‘name’ is the name of the metric.

iterate over each metric. yields identifer, metric

iterate over each metric. yields identifer, metric

Create a new Histogram metric ‘instance’ is usually an object owning this metric, but it can be a string. ‘name’ is the name of the metric.

Create a new Histogram metric ‘instance’ is usually an object owning this metric, but it can be a string. ‘name’ is the name of the metric.

Create a new Meter metric ‘instance’ is usually an object owning this metric, but it can be a string. ‘name’ is the name of the metric.

Create a new Meter metric ‘instance’ is usually an object owning this metric, but it can be a string. ‘name’ is the name of the metric.

Create a new Timer metric ‘instance’ is usually an object owning this metric, but it can be a string. ‘name’ is the name of the metric.

Create a new Timer metric ‘instance’ is usually an object owning this metric, but it can be a string. ‘name’ is the name of the metric.

[Validate]