2.0.0 • Published 6 years ago

egg-qwatcher v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

egg-qwatcher

qunar watcher for egg

Install

$ npm i egg-qwatcher --save

Usage

// {app_root}/config/plugin.js
exports.qwatcher = {
  enable: true,
  package: 'egg-qwatcher',
};

Configuration

// {app_root}/config/config.default.js
exports.qwatcher = {
    // 项目
    projectId: 'event_node',
    host: 'host',
    port: 2013,
    // 类别
    category: 't.fe.beta'
};

如果出现错误,会往 common-error.log 中记录,而不会抛出异常。

see config/config.default.js for more detail.

Example

记录某个指标次数

// 单指标
yield app.qwatcher.recordCount('api_perfect')

// 多指标同时记录
yield app.qwatcher.recordCount('api_perfect', 'api_entrence')

记录某个指标的时间值

// 单指标
yield app.qwatcher.recordTime('api_perfect', 120)

// 多指标同时记录,比如记录页面加载时间等
yield app.qwatcher.recordTime({
  dns: 10,
  ready: 20
})

Questions & Suggestions

Please open an issue here.

Version

2.0.0版本以上为egg2版本插件

License

MIT

2.0.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago