{"_id":"metrics-common","_rev":"372194","name":"metrics-common","description":"[![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/","dist-tags":{"latest":"1.1.6"},"maintainers":[{"name":"czy88840616","email":""}],"time":{"modified":"2021-07-27T02:41:13.000Z","created":"2018-10-17T08:07:33.319Z","1.1.6":"2018-12-19T09:21:20.494Z","1.1.5":"2018-12-19T03:37:12.660Z","1.1.4":"2018-12-13T08:26:01.701Z","1.1.3":"2018-12-12T04:24:33.940Z","1.1.2":"2018-12-12T03:56:00.837Z","1.1.0":"2018-12-08T09:01:19.650Z","1.0.0":"2018-10-17T08:07:33.319Z"},"users":{},"repository":{"type":"git","url":"git://github.com/midwayjs/metrics-common.git"},"versions":{"1.1.6":{"name":"metrics-common","version":"1.1.6","main":"dist/index","typings":"dist/index.d.ts","scripts":{"build":"npm run lint && rm -rf ./dist && midway-bin build -c","lint":"tslint --format prose -c ./tslint.json src/**/*.ts test/**/*.ts","test":"npm run lint && midway-bin clean && midway-bin test --ts","cov":"midway-bin cov --tes","ci":"npm run test","prepublishOnly":"npm run build"},"keywords":["metrics","alimetrics"],"repository":{"type":"git","url":"git://github.com/midwayjs/metrics-common.git"},"license":"MIT","devDependencies":{"@types/chai":"^3.5.2","@types/lodash":"^4.14.109","@types/mocha":"^2.2.41","@types/node":"^10.5.5","chai":"^4.2.0","git-hooks":"^1.1.10","midway-bin":"^0.3.8","ts-node":"^7.0.1","tslint":"^5.9.1","typescript":"^2.8.0"},"dependencies":{"debug":"^4.1.0","long":"^4.0.0","xorshift":"^1.1.1"},"gitHead":"b64ba9bf9e983e3b948ce40e19254e220a2ae2d1","description":"[![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/","bugs":{"url":"https://github.com/midwayjs/metrics-common/issues"},"homepage":"https://github.com/midwayjs/metrics-common#readme","_id":"metrics-common@1.1.6","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"czy88840616","email":"czy88840616@gmail.com"},"dist":{"shasum":"096c5700d6db8ea02d953feb66ee5aa007f7b8df","size":38831,"noattachment":false,"key":"/metrics-common/-/metrics-common-1.1.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/metrics-common/download/metrics-common-1.1.6.tgz"},"maintainers":[{"name":"czy88840616","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/metrics-common_1.1.6_1545211280324_0.5936124067300457"},"_hasShrinkwrap":false,"publish_time":1545211280494,"_cnpm_publish_time":1545211280494},"1.1.5":{"name":"metrics-common","version":"1.1.5","main":"dist/index","typings":"dist/index.d.ts","scripts":{"build":"npm run lint && rm -rf ./dist && midway-bin build -c","lint":"tslint --format prose -c ./tslint.json src/**/*.ts test/**/*.ts","test":"npm run lint && midway-bin clean && midway-bin test --ts","cov":"midway-bin cov --tes","ci":"npm run test","prepublishOnly":"npm run build"},"keywords":["metrics","alimetrics"],"repository":{"type":"git","url":"git://github.com/midwayjs/metrics-common.git"},"license":"MIT","devDependencies":{"@types/chai":"^3.5.2","@types/lodash":"^4.14.109","@types/mocha":"^2.2.41","@types/node":"^10.5.5","chai":"^4.2.0","git-hooks":"^1.1.10","midway-bin":"^0.3.8","ts-node":"^7.0.1","tslint":"^5.9.1","typescript":"^2.8.0"},"dependencies":{"debug":"^4.1.0","long":"^4.0.0","xorshift":"^1.1.1"},"gitHead":"dfceceea5b40d0633a609d37cc06753d647ac886","description":"[![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/","bugs":{"url":"https://github.com/midwayjs/metrics-common/issues"},"homepage":"https://github.com/midwayjs/metrics-common#readme","_id":"metrics-common@1.1.5","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"czy88840616","email":"czy88840616@gmail.com"},"dist":{"shasum":"5e82c4843d250a5d52d387d345aaf36aabe3a15e","size":38791,"noattachment":false,"key":"/metrics-common/-/metrics-common-1.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/metrics-common/download/metrics-common-1.1.5.tgz"},"maintainers":[{"name":"czy88840616","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/metrics-common_1.1.5_1545190632505_0.9692497622453549"},"_hasShrinkwrap":false,"publish_time":1545190632660,"_cnpm_publish_time":1545190632660},"1.1.4":{"name":"metrics-common","version":"1.1.4","main":"dist/index","typings":"dist/index.d.ts","scripts":{"build":"npm run lint && rm -rf ./dist && midway-bin build -c","lint":"tslint --format prose -c ./tslint.json src/**/*.ts test/**/*.ts","test":"npm run lint && midway-bin clean && midway-bin test --ts","cov":"midway-bin cov --tes","ci":"npm run test","prepublishOnly":"npm run build"},"keywords":["metrics","alimetrics"],"repository":{"type":"git","url":"git://github.com/midwayjs/metrics-common.git"},"license":"MIT","devDependencies":{"@types/chai":"^3.5.2","@types/lodash":"^4.14.109","@types/mocha":"^2.2.41","@types/node":"^10.5.5","chai":"^4.2.0","git-hooks":"^1.1.10","midway-bin":"^0.3.8","ts-node":"^7.0.1","tslint":"^5.9.1","typescript":"^2.8.0"},"dependencies":{"debug":"^4.1.0","long":"^4.0.0","xorshift":"^1.1.1"},"gitHead":"48862ed3c2da7f8f3c140abbfc09e6c007a0ae6a","description":"[![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/","bugs":{"url":"https://github.com/midwayjs/metrics-common/issues"},"homepage":"https://github.com/midwayjs/metrics-common#readme","_id":"metrics-common@1.1.4","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"czy88840616","email":"czy88840616@gmail.com"},"dist":{"shasum":"58ee58cebfa6d321385aacf9873180aa6483cc95","size":38641,"noattachment":false,"key":"/metrics-common/-/metrics-common-1.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/metrics-common/download/metrics-common-1.1.4.tgz"},"maintainers":[{"name":"czy88840616","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/metrics-common_1.1.4_1544689561500_0.22812438445348282"},"_hasShrinkwrap":false,"publish_time":1544689561701,"_cnpm_publish_time":1544689561701},"1.1.3":{"name":"metrics-common","version":"1.1.3","main":"dist/index","typings":"dist/index.d.ts","scripts":{"build":"npm run lint && rm -rf ./dist && midway-bin build","lint":"tslint --format prose -c ./tslint.json src/**/*.ts test/**/*.ts","test":"npm run lint && midway-bin clean && midway-bin test --ts","cov":"midway-bin cov --tes","ci":"npm run test","prepublishOnly":"npm run build"},"keywords":["metrics","alimetrics"],"repository":{"type":"git","url":"git://github.com/midwayjs/metrics-common.git"},"license":"MIT","devDependencies":{"@types/chai":"^3.5.2","@types/lodash":"^4.14.109","@types/mocha":"^2.2.41","@types/node":"^10.5.5","chai":"^4.2.0","git-hooks":"^1.1.10","midway-bin":"^0.3.8","ts-node":"^7.0.1","tslint":"^5.9.1","typescript":"^2.8.0"},"dependencies":{"debug":"^4.1.0","long":"^4.0.0","xorshift":"^1.1.1"},"gitHead":"05d5a955f289bba40ce84f0a8b2f77def4ed1aab","description":"[![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/","bugs":{"url":"https://github.com/midwayjs/metrics-common/issues"},"homepage":"https://github.com/midwayjs/metrics-common#readme","_id":"metrics-common@1.1.3","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"czy88840616","email":"czy88840616@gmail.com"},"dist":{"shasum":"25730752106b1056b41477c5f83553c8a593c108","size":38660,"noattachment":false,"key":"/metrics-common/-/metrics-common-1.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/metrics-common/download/metrics-common-1.1.3.tgz"},"maintainers":[{"name":"czy88840616","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/metrics-common_1.1.3_1544588673745_0.272830257645688"},"_hasShrinkwrap":false,"publish_time":1544588673940,"_cnpm_publish_time":1544588673940},"1.1.2":{"name":"metrics-common","version":"1.1.2","main":"dist/index","typings":"dist/index.d.ts","scripts":{"build":"npm run lint && rm -rf ./dist && midway-bin build","lint":"tslint --format prose -c ./tslint.json src/**/*.ts test/**/*.ts","test":"npm run lint && midway-bin clean && midway-bin test --ts","cov":"midway-bin cov --tes","ci":"npm run test","prepublishOnly":"npm run build"},"keywords":["metrics","alimetrics"],"repository":{"type":"git","url":"git://github.com/midwayjs/metrics-common.git"},"license":"MIT","devDependencies":{"@types/chai":"^3.5.2","@types/lodash":"^4.14.109","@types/mocha":"^2.2.41","@types/node":"^10.5.5","chai":"^4.2.0","git-hooks":"^1.1.10","midway-bin":"^0.3.8","ts-node":"^7.0.1","tslint":"^5.9.1","typescript":"^2.8.0"},"dependencies":{"long":"^4.0.0","xorshift":"^1.1.1"},"gitHead":"f9accc8e6de0e7f58fc6a552a6970ec5e13ece13","description":"[![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/","bugs":{"url":"https://github.com/midwayjs/metrics-common/issues"},"homepage":"https://github.com/midwayjs/metrics-common#readme","_id":"metrics-common@1.1.2","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"czy88840616","email":"czy88840616@gmail.com"},"dist":{"shasum":"81359e46e72cfcb76059ac1d4ff4a140be06e59d","size":38636,"noattachment":false,"key":"/metrics-common/-/metrics-common-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/metrics-common/download/metrics-common-1.1.2.tgz"},"maintainers":[{"name":"czy88840616","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/metrics-common_1.1.2_1544586960677_0.809356502147764"},"_hasShrinkwrap":false,"publish_time":1544586960837,"_cnpm_publish_time":1544586960837},"1.1.0":{"name":"metrics-common","version":"1.1.0","main":"dist/index","typings":"dist/index.d.ts","scripts":{"build":"npm run lint && rm -rf ./dist && midway-bin build","lint":"tslint --format prose -c ./tslint.json src/**/*.ts test/**/*.ts","test":"npm run lint && midway-bin clean && midway-bin test --ts","cov":"midway-bin cov --tes","ci":"npm run test","prepublishOnly":"npm run build"},"keywords":["metrics","alimetrics"],"repository":{"type":"git","url":"git://github.com/midwayjs/metrics-common.git"},"license":"MIT","devDependencies":{"@types/chai":"^3.5.2","@types/lodash":"^4.14.109","@types/mocha":"^2.2.41","@types/node":"^10.5.5","chai":"^4.2.0","git-hooks":"^1.1.10","midway-bin":"^0.3.8","ts-node":"^7.0.1","tslint":"^5.9.1","typescript":"^2.8.0"},"dependencies":{"long":"^4.0.0","xorshift":"^1.1.1"},"gitHead":"bcf693fffe99f5859ee75c6c35277f64ce41bceb","description":"[![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/","bugs":{"url":"https://github.com/midwayjs/metrics-common/issues"},"homepage":"https://github.com/midwayjs/metrics-common#readme","_id":"metrics-common@1.1.0","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"czy88840616","email":"czy88840616@gmail.com"},"dist":{"shasum":"0e4f5cd020ff7cf09236d27409efecce9e390c03","size":38449,"noattachment":false,"key":"/metrics-common/-/metrics-common-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/metrics-common/download/metrics-common-1.1.0.tgz"},"maintainers":[{"name":"czy88840616","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/metrics-common_1.1.0_1544259679476_0.6491381880349438"},"_hasShrinkwrap":false,"publish_time":1544259679650,"_cnpm_publish_time":1544259679650},"1.0.0":{"name":"metrics-common","version":"1.0.0","main":"dist/index","typings":"dist/index.d.ts","scripts":{"build":"npm run lint && rm -rf ./dist && midway-bin build","lint":"tslint --format prose -c ./tslint.json src/**/*.ts test/**/*.ts","test":"npm run lint && midway-bin clean && midway-bin test --ts","cov":"midway-bin cov --tes","ci":"npm run test","prepublishOnly":"npm run build"},"keywords":["metrics","alimetrics"],"repository":{"type":"git","url":"git://github.com/midwayjs/metrics-common.git"},"license":"MIT","devDependencies":{"@types/chai":"^3.5.2","@types/lodash":"^4.14.109","@types/mocha":"^2.2.41","@types/node":"^10.5.5","chai":"^4.2.0","git-hooks":"^1.1.10","midway-bin":"^0.3.8","ts-node":"^7.0.1","tslint":"^5.9.1","typescript":"^2.8.0"},"dependencies":{},"gitHead":"c504546490c6575067bcff0d811280644e3246ec","description":"## Overview","bugs":{"url":"https://github.com/midwayjs/metrics-common/issues"},"homepage":"https://github.com/midwayjs/metrics-common#readme","_id":"metrics-common@1.0.0","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"czy88840616","email":"czy88840616@gmail.com"},"dist":{"shasum":"df5dacb9bf30cf4a41b6168b367f3c9b808d7689","size":35336,"noattachment":false,"key":"/metrics-common/-/metrics-common-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/metrics-common/download/metrics-common-1.0.0.tgz"},"maintainers":[{"name":"czy88840616","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/metrics-common_1.0.0_1539763652943_0.25107704278503395"},"_hasShrinkwrap":false,"publish_time":1539763653319,"_cnpm_publish_time":1539763653319}},"readme":"# Metrics Common\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/midwayjs/metrics-common/blob/master/LICENSE)\n[![GitHub tag](https://img.shields.io/github/tag/midwayjs/metrics-common.svg)]()\n[![Build Status](https://travis-ci.org/midwayjs/metrics-common.svg?branch=master)](https://travis-ci.org/midwayjs/metrics-common)\n[![Test Coverage](https://img.shields.io/codecov/c/github/midwayjs/metrics-common/master.svg)](https://codecov.io/gh/midwayjs/metrics-common/branch/master)\n[![Package Quality](http://npm.packagequality.com/shield/metrics-common.svg)](http://packagequality.com/#?package=metrics-common)\n[![Known Vulnerabilities](https://snyk.io/test/npm/metrics-common/badge.svg)](https://snyk.io/test/npm/metrics-common)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/midwayjs/metrics-common/pulls)\n\n## Overview\n\nMetrics 的原意是 **指标**，用于反馈应用的当前状况的数据值，所以 Metrics 最后的结果都是**数字**。\n\n在业界标准的 Metrics 类型中，有几种标准的类型。\n\n- Gauge 瞬时值\n- Counter 计数器\n- Meter 吞吐率度量器\n- Histogram 直方分布度量器\n\n本包扩展出一堆基础 Metrics 指标的实现。\n\n包括常见的 Gauge, Counter, Timer, Histogram, Meter，以及扩展出来的 BucketCounter, FastCompass 等。\n\n## Install\n\n```shell\nnpm i metrics-common --save\n```\n\n## Usage\n\n```js\nimport { MetricsServerManager } from 'metrics-common';\n\nconst manager = new MetricsServerManager();\n\nconst app = koa();\n\napp.use(async (ctx) => {\n  const counter = manager.getCounter('system', 'test.system.counter');\n  const histogram = manager.getHistogram('system', 'test.system.histogram');\n  const timer = manager.getTimer('system', 'test.system.timer');\n  const meter = manager.getMeter('system', 'test.system.meter');\n  const fastcompass = manager.getFastCompass('system', 'test.system.fastcompass');\n  counter.inc();\n});\n\n```\n","_attachments":{},"homepage":"https://github.com/midwayjs/metrics-common#readme","bugs":{"url":"https://github.com/midwayjs/metrics-common/issues"},"license":"MIT"}