Name: egg-instrument
Owner: egg
Description: Compute the duration of an operation in local environment.
Created: 2017-01-20 06:06:06.0
Updated: 2018-03-30 15:27:14.0
Pushed: 2017-11-23 07:19:49.0
Size: 16
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Compute the duration of an operation in local environment.
m i egg-instrument --save
app_root}/config/plugin.js
rts.instrument = {
able: true,
ckage: 'egg-instrument',
Instrument can calculate the duration of an operation, for example
pp/controller/home.js
rts.index = async ctx => {
nst ins = ctx.instrument('service', 'home.getData');
nst data = await ctx.service.home.getData();
s.end();
x.body = data;
Then you can see the infomation in console
-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
.
see config/config.default.js for more detail.
Please open an issue here.