Comparing version 0.3.2 to 0.3.5
{ | ||
"name": "metricador", | ||
"description": "Core library to add performance metrics to your Node.js application.", | ||
"version": "0.3.2", | ||
"version": "0.3.5", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
[![Circle CI](https://circleci.com/gh/ovidiubute/metricador.svg?style=svg)](https://circleci.com/gh/ovidiubute/metricador) | ||
[![codecov.io](https://codecov.io/github/ovidiubute/metricador/coverage.svg?branch=master)](https://codecov.io/github/ovidiubute/metricador?branch=master) | ||
[![david-dm](https://david-dm.org/ovidiubute/metricador.svg)](https://david-dm.org/ovidiubute/metricador.svg) | ||
[![Inline docs](http://inch-ci.org/github/ovidiubute/metricador.svg?branch=master)](http://inch-ci.org/github/ovidiubute/metricador) | ||
[![Code Climate](https://codeclimate.com/github/ovidiubute/metricador/badges/gpa.svg)](https://codeclimate.com/github/ovidiubute/metricador) | ||
@@ -37,2 +40,2 @@ # Metricador | ||
# License | ||
[MIT](https://github.com/ovidiubute/metricador/blob/master/LICENSE) | ||
[MIT](https://github.com/ovidiubute/metricador/blob/master/LICENSE) |
@@ -17,3 +17,4 @@ "use strict"; | ||
/** | ||
* Builds a new Counter with the given name and adds it to the registry | ||
* Builds a new Counter with the given name and adds it to the registry OR returns | ||
* an already registered Counter with the given name. | ||
* @param {string} name Name of the Counter | ||
@@ -27,3 +28,4 @@ * @return {Counter} Counter instance | ||
/** | ||
* Builds a new Histogram with the given name and adds it to the registry | ||
* Builds a new Histogram with the given name and adds it to the registry OR returns | ||
* an already registered Histogram with the given name. | ||
* @param {string} name Name of the Histogram | ||
@@ -37,3 +39,4 @@ * @return {Histogram} Histogram instance | ||
/** | ||
* Builds a new Gauge with the given name and adds it to the registry | ||
* Builds a new Gauge with the given name and adds it to the registry OR returns | ||
* an already registered Gauge with the given name. | ||
* @param {string} name Name of the Counter | ||
@@ -107,3 +110,2 @@ * @return {Gauge} Gauge instance | ||
* @return {object} Metric instance | ||
* @throws Error If name already exists within the Registry | ||
* @private | ||
@@ -117,3 +119,3 @@ */ | ||
} else { | ||
throw new Error(util.format('A metric with this name <%s> has already been registered!', name)); | ||
return this._metrics[name]; | ||
} | ||
@@ -120,0 +122,0 @@ }; |
41
81871
33
1652