chore: update travis (#9)
Compute the duration of an operation in local environment.
$ npm i egg-instrument --save
// {app_root}/config/plugin.js exports.instrument = { enable: true, package: 'egg-instrument', };
Instrument can calculate the duration of an operation, for example
// app/controller/home.js exports.index = async ctx => { const ins = ctx.instrument('service', 'home.getData'); const data = await ctx.service.home.getData(); ins.end(); ctx.body = data; };
Then you can see the infomation in console
2017-01-20 15:32:58,567 INFO 30445 [-/127.0.0.1/-/1024ms GET /] [service] home.getData 1006ms
If you are not in context level, you can use app.instrument or agent.instrument.
app.instrument
agent.instrument
see config/config.default.js for more detail.
Please open an issue here.
MIT
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
egg-instrument
Compute the duration of an operation in local environment.
Install
Usage
Instrument can calculate the duration of an operation, for example
Then you can see the infomation in console
If you are not in context level, you can use
app.instrumentoragent.instrument.Configuration
see config/config.default.js for more detail.
Questions & Suggestions
Please open an issue here.
License
MIT