connect-metric
Middleware that exposes metric for logging in the context of a user
Last updated 7 years ago by camshaft .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install connect-metric 
SYNC missed versions from official npm registry.

connect-metric Build Status

Middleware that exposes metric for logging in the context of a request

Usage

var app = express()
  , metric = require("connect-metric");

app.use(metric());

app.get("/", function(req, res){
  req.metric("home_page", 1, "views"); // measure=home_page val=1 units=views
});

Options

metric(context, options);

context

The metric logger can inherit context

app.use(metric({foo: "bar"}));

app.get("/", function(req, res){
  req.metric("home_page", 1, "views"); // foo=bar measure=home_page val=1 units=views
});

options

options.request_id

Header name that provides a request id.

Current Tags

  • 1.0.1                                ...           latest (7 years ago)

5 Versions

  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
  • 0.2.1                                ...           8 years ago
  • 0.2.0                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |