...
|
...
|
@@ -182,15 +182,15 @@ const profile_service = { |
|
|
|
|
|
return {code: 200, data: rows}
|
|
|
},
|
|
|
async server_time(ctx, app) {
|
|
|
async server_time(ctx, app, start, length) {
|
|
|
const slowRouterModel = new SlowRouteModel(ctx);
|
|
|
const result = await slowRouterModel.getList(app);
|
|
|
const result = await slowRouterModel.getList(app, start, length);
|
|
|
|
|
|
return {cde: 200, data: result};
|
|
|
return result;
|
|
|
},
|
|
|
async error(ctx, app) {
|
|
|
async error(ctx, app, start, length) {
|
|
|
const errorModel = new ErrorModel(ctx);
|
|
|
const result = await errorModel.getList(app);
|
|
|
const result = await errorModel.getList(app, start, length);
|
|
|
|
|
|
return {cde: 200, data: result};
|
|
|
}
|
...
|
...
|
@@ -201,19 +201,25 @@ const profile_controller = { |
|
|
await ctx.render('action/profile_server');
|
|
|
},
|
|
|
async server_mean_report_json(ctx) {
|
|
|
const app = ctx.query.app;
|
|
|
const app = parseInt(ctx.query.app) || 0;
|
|
|
const start = parseInt(ctx.query.start) || 0;
|
|
|
const length = parseInt(ctx.query.length) || 10;
|
|
|
const draw = ctx.query.draw;
|
|
|
|
|
|
const result = await profile_service.server_time(ctx, app);
|
|
|
ctx.body = result;
|
|
|
const result = await profile_service.server_time(ctx, app, start, length);
|
|
|
ctx.body = Object.assign({}, result, {draw});
|
|
|
},
|
|
|
async error_report_index(ctx) {
|
|
|
await ctx.render('action/profile_error');
|
|
|
},
|
|
|
async error_report_json(ctx) {
|
|
|
const app = ctx.query.app;
|
|
|
const app = parseInt(ctx.query.app) || 0;
|
|
|
const start = parseInt(ctx.query.start) || 0;
|
|
|
const length = parseInt(ctx.query.length) || 10;
|
|
|
const draw = ctx.query.draw;
|
|
|
|
|
|
const result = await profile_service.error(ctx, app);
|
|
|
ctx.body = result;
|
|
|
const result = await profile_service.error(ctx, app, start, length);
|
|
|
ctx.body = Object.assign({}, result, {draw});
|
|
|
}
|
|
|
|
|
|
};
|
...
|
...
|
|