New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

metrics-common

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metrics-common

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/midwayjs/metrics-common/blob/master/LICENSE) [![GitHub tag](https://img.shields.io/github/tag/midwayjs/metrics-common.svg)]() [![Build Status](https://travis-ci.org/

latest
Source
npmnpm
Version
1.1.6
Version published
Weekly downloads
15
-25%
Maintainers
1
Weekly downloads
 
Created
Source

Metrics Common

GitHub license GitHub tag Build Status Test Coverage Package Quality Known Vulnerabilities PRs Welcome

Overview

Metrics 的原意是 指标,用于反馈应用的当前状况的数据值,所以 Metrics 最后的结果都是数字

在业界标准的 Metrics 类型中,有几种标准的类型。

  • Gauge 瞬时值
  • Counter 计数器
  • Meter 吞吐率度量器
  • Histogram 直方分布度量器

本包扩展出一堆基础 Metrics 指标的实现。

包括常见的 Gauge, Counter, Timer, Histogram, Meter,以及扩展出来的 BucketCounter, FastCompass 等。

Install

npm i metrics-common --save

Usage

import { MetricsServerManager } from 'metrics-common';

const manager = new MetricsServerManager();

const app = koa();

app.use(async (ctx) => {
  const counter = manager.getCounter('system', 'test.system.counter');
  const histogram = manager.getHistogram('system', 'test.system.histogram');
  const timer = manager.getTimer('system', 'test.system.timer');
  const meter = manager.getMeter('system', 'test.system.meter');
  const fastcompass = manager.getFastCompass('system', 'test.system.fastcompass');
  counter.inc();
});

Keywords

metrics

FAQs

Package last updated on 19 Dec 2018

Did you know?

Socket

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.

Install

Related posts