3.2.0 • Published 6 years ago

cf-metrics v3.2.0

Weekly downloads
97
License
-
Repository
github
Last release
6 years ago

Metrics

Log site usage metrics to statsd. Provides a Clock-specific wrapper around Lynx.

When logging metrics be sure to follow the naming conventions outlined in the Statsd Metric Naming Conventions document.

Usage

var Metrics = require('cf-metrics')
  , metrics = new Metrics(
    '127.0.0.1'
    , 8325
    , { client: 'nuk'
      , platform: 'sunperks'
      , application: 'site'
      , environment: 'production'
      }
    )

Timers

var timer = metrics.createTimer('backend-api', 'Hive', 'get-code')

apiRequest(function(err) {
  timer.stop()
})

Counters

metrics.increment('external-api', 'user', 'login', 'succeeded')

There is no need to create a counter if a timer for the same action already exists. Statsd will automatically create a counter for every timer.

The final argument of a counter should always be a past-tense verb, e.g.:

  • succeeded
  • failed

Useful links

3.2.0

6 years ago

3.1.0

6 years ago

3.0.1

8 years ago

2.1.0

8 years ago

1.2.0

8 years ago

1.1.1

8 years ago

2.0.0

8 years ago

3.0.0

8 years ago