Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cf-metrics

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-metrics

Log usage metrics to statsd.

  • 3.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

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

Keywords

FAQs

Package last updated on 27 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc