Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@metrics/metric
Advanced tools
The metric class definition which metric objects in the @metrics library is instansiated from
The metric class definition which metric objects is instansiated from.
$ npm install @metrics/metric
const Metric = require('@metrics/metric');
const metric = new Metric({
name: 'unique_metric_name',
description: 'Description of metric being collected',
value: 10,
});
This module is the metric class definition which metric objects is instansiated from.
All modules in the @metric
family which exchange data over the stream
API exchange
this object type. This object definition is intended to be static over time so modules
who depend on a module in the @metric
family can rely on exchanging data over time.
This class definition is prefered over object literals when exchanging data over the
stream
API because it will guarantee that all properties are available on the
object. All undefined properties will have a null
value, making sure they are kept
when serialized to JSON.
Create a new Metric instance.
const Metric = require('@metrics/metric');
const metric = new Metric(options);
An object literal reflecting the properties of this class. The following properties is required:
String
- The name of the metric.String|Number
- The value of the metric.The instansiated object has the following properties:
The name of the metric.
a-z,A-Z,0-9,_
.The value of the metric.
Number
or String
.The source of the metric in terms of where it originated.
a-z,A-Z,0-9,_
.A human readable description of the metric.
String
.A timestamp of when the metric was created.
Number
.N/A.
Number
.Available to be used to hold any misc data. In practice, meta can be used as a way to label metrics. Use each key of the meta object as the label name and the value as the label value.
Object
.[1.0.0] - 2018-12-31
@metrics/client
.FAQs
The metric class definition which metric objects in the @metrics library is instansiated from
The npm package @metrics/metric receives a total of 1,818 weekly downloads. As such, @metrics/metric popularity was classified as popular.
We found that @metrics/metric demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.