prom-client
Advanced tools
Comparing version 3.0.4 to 3.1.0
@@ -12,1 +12,2 @@ /** | ||
exports.histogram = require('./lib/histogram'); | ||
exports.summary = require('./lib/summary'); |
{ | ||
"name": "prom-client", | ||
"version": "3.0.4", | ||
"version": "3.1.0", | ||
"description": "Client for prometheus", | ||
@@ -34,4 +34,5 @@ "main": "index.js", | ||
"object-hash": "^0.9.2", | ||
"tdigest": "^0.1.1", | ||
"util-extend": "^1.0.1" | ||
} | ||
} |
@@ -13,3 +13,3 @@ # Prometheus client for node.js [![Build Status](https://travis-ci.org/siimon/prom-client.svg?branch=master)](https://travis-ci.org/siimon/prom-client) | ||
All metric types has 2 mandatory parameters, name and help. | ||
All metric types has 2 mandatory parameters, name and help. | ||
@@ -56,3 +56,3 @@ #### Counter | ||
**Configuration** | ||
**Configuration** | ||
@@ -62,3 +62,3 @@ The defaults buckets are intended to cover usual web/rpc requests, this can however be overriden. | ||
var Client = require('prom-client'); | ||
new Client.histogram('metric_name', 'metric_help', { | ||
new Client.histogram('metric_name', 'metric_help', { | ||
buckets: [ 0.10, 5, 15, 50, 100, 500 ] | ||
@@ -84,4 +84,35 @@ }); | ||
#### Labels | ||
#### Summary | ||
Summaries calculate percentiles of observed values. | ||
**Configuration** | ||
The default percentiles are: 0.01, 0.05, 0.5, 0.9, 0.95, 0.99, 0.999. But they can be overriden like this: | ||
``` | ||
var Client = require('prom-client'); | ||
new Client.summary('metric_name', 'metric_help', { | ||
percentiles: [ 0.01, 0.1, 0.9, 0.99 ] | ||
}); | ||
``` | ||
Usage example | ||
``` | ||
var Client = require('prom-client'); | ||
var summary = new Client.summary('metric_name', 'metric_help'); | ||
summary.observe(10); | ||
``` | ||
Utility to observe request durations | ||
``` | ||
var end = summary.startTimer(); | ||
xhrRequest(function(err, res) { | ||
end(); // Observes the value to xhrRequests duration in seconds | ||
}); | ||
``` | ||
#### Labels | ||
All metrics take an array as 3rd parameter that should include all supported label keys. There are 2 ways to add values to the labels | ||
@@ -88,0 +119,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55544
21
1269
122
3
+ Addedtdigest@^0.1.1
+ Addedbintrees@1.0.2(transitive)
+ Addedtdigest@0.1.2(transitive)