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

lynx-express

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lynx-express

Express middleware for sending response status counts and response times to statsd

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

lynx-express

Express Middleware for sending data to StatsD.

Please refer to the Lynx documentation for more in depth details for configuring the Lynx StatsD Client.

Once your client is configured, it's pretty straight forward to configure lynx-express.


// Import lynx and lynx-express
var Lynx = require('lynx');
var LynxExpress = require('lynx-express');

// Setup your Lynx StatsD client as normal, optionally passing a prefix (like 'express')
var metrics = new Lynx('localhost', 8125, {prefix: 'express'});

// Create the Express middleware passing in the Lynx StatsD Client you created
var statsdMiddleware = LynxExpress(metrics);

// Tell Express to use your statsD middleware
server.use(statsdMiddleware());

By default lynx-express will track the counts for each response code and a response time for the overall system. What's more useful is to have timing for each route in your Express app. lynx-express can be configured to give you per-route timing by adding an option timeByUrl to the middleware constructor.

server.use(statsdMiddleware({timeByUrl: true})}

Keywords

FAQs

Package last updated on 17 Sep 2013

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