
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
measured-core
Advanced tools
The core measured library that has the Metric interfaces and implementations.
npm install measured-core
The core library has the following metrics classes:
Values that can be read instantly via a supplied call back.
Just like a Gauge but its value is set directly rather than supplied by a callback.
Like a mix of the regular and settable Gauge it takes a call back that returns a promise that will resolve the cached value and an interval that it should call the callback on to update its cached value.
Counters are things that increment or decrement.
Timers are a combination of Meters and Histograms. They measure the rate as well as distribution of scalar events.
Keeps a reservoir of statistically relevant values to explore their distribution.
Things that are measured as events / interval.
The core library comes with a basic registry class
that is not aware of dimensions / tags and leaves reporting up to you.
See The measured-core modules for the full list of exports for require('measured-core').
Step 1: Add measurements to your code. For example, lets track the requests/sec of a http server:
var http = require('http');
var stats = require('measured').createCollection();
http.createServer(function(req, res) {
stats.meter('requestsPerSecond').mark();
res.end('Thanks');
}).listen(3000);
Step 2: Show the collected measurements (more advanced examples follow later):
setInterval(function() {
console.log(stats.toJSON());
}, 1000);
This will output something like this every second:
{ requestsPerSecond:
{ mean: 1710.2180279856818,
count: 10511,
'currentRate': 1941.4893498239829,
'1MinuteRate': 168.08263156623656,
'5MinuteRate': 34.74630977619571,
'15MinuteRate': 11.646507524106095 } }
Step 3: Aggregate the data into your backend of choice. Here are a few time series data aggregators.
The prom-client package is a Prometheus client for Node.js that provides similar functionality for measuring and monitoring metrics. It includes features for creating counters, gauges, histograms, and summaries. Compared to measured-core, prom-client is specifically designed to work with Prometheus, a popular monitoring and alerting toolkit.
The statsd-client package is a StatsD client for Node.js that allows you to send metrics to a StatsD server. It supports counters, timers, gauges, and sets. Compared to measured-core, statsd-client is designed to work with StatsD, a network daemon that listens for statistics and aggregates them for visualization.
The node-statsd package is another StatsD client for Node.js. It provides similar functionality to statsd-client, allowing you to send metrics to a StatsD server. It supports counters, timers, gauges, and sets. Compared to measured-core, node-statsd is also designed to work with StatsD for metric aggregation and visualization.
FAQs
A Node library for measuring and reporting application-level metrics.
The npm package measured-core receives a total of 337,117 weekly downloads. As such, measured-core popularity was classified as popular.
We found that measured-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

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.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.