Authored by 陈峰

Merge branch 'feature/yoluckTip' into 'master'

Feature/yoluck tip



See merge request !91
... ... @@ -77,7 +77,7 @@ app.use(global.yoho.httpCtx());
app.enable('trust proxy');
app.use((req, res, next) => {
req.isApmReport = _.get(req.app.locals, 'isProduction');
req.isApmReport = _.get(req.app.locals, 'isProduction', false);
next();
});
... ...
... ... @@ -82,7 +82,7 @@
"xlsx": "^0.11.16",
"xlsx-style": "^0.8.13",
"yoho-md5": "^2.0.0",
"yoho-node-lib": "^0.6.33",
"yoho-node-lib": "=0.6.44",
"yoho-zookeeper": "^1.0.8"
},
"devDependencies": {
... ...
... ... @@ -2,7 +2,6 @@ const mysql = require('mysql');
const _ = require('lodash');
const md5 = require('yoho-md5');
const qs = require('querystring');
const monitorType = 'sql';
class SqlHelper {
constructor(database) {
... ... @@ -10,6 +9,7 @@ class SqlHelper {
this.logger = global.yoho.logger;
this.cache = global.yoho.cache;
this.monitor = global.yoho.monitorSender;
this.monitorType = _.get(this.monitor, 'type.SQL');
database = database || 'mysql';
this.createPool(database);
}
... ... @@ -97,12 +97,12 @@ class SqlHelper {
// 写入缓存
cacheTime && this.cache.set(cacheKey, result, cacheTime);
resolve(result);
this.monitor && this.monitor.tallySuccess(monitorType);
this.monitor && this.monitor.tallySuccess(this.monitorType);
}
});
}).catch(e => {
reject(e);
this.monitor && this.monitor.tallyFail(monitorType, e);
this.monitor && this.monitor.tallyFail(this.monitorType, e);
});
});
}
... ...
... ... @@ -4906,7 +4906,15 @@ inflight@^1.0.4, inflight@~1.0.6:
once "^1.3.0"
wrappy "1"
influx-batch-sender@^0.1.7, influx-batch-sender@^0.1.9:
influx-batch-sender@=0.1.7:
version "0.1.7"
resolved "http://npm.yohops.com/influx-batch-sender/-/influx-batch-sender-0.1.7.tgz#9f925bfc500e886cae27001b3cc20f2584fa464a"
dependencies:
debug "^3.0.1"
lodash "^4.17.4"
request "^2.83.0"
influx-batch-sender@^0.1.9:
version "0.1.10"
resolved "http://npm.yohops.com/influx-batch-sender/-/influx-batch-sender-0.1.10.tgz#697e51ab8e5aa20fb9cc3b07a2922e069b86c229"
dependencies:
... ... @@ -12093,13 +12101,13 @@ yoho-mlellipsis@0.0.3:
version "0.0.3"
resolved "http://npm.yohops.com/yoho-mlellipsis/-/yoho-mlellipsis-0.0.3.tgz#5f743eeb74ff6f2df58a802cff7cd8ad8e4b21f4"
yoho-node-lib@^0.6.33:
version "0.6.34"
resolved "http://npm.yohops.com/yoho-node-lib/-/yoho-node-lib-0.6.34.tgz#c650e06bfc530cf13c79cf4b3e08bc5d15345933"
yoho-node-lib@=0.6.44:
version "0.6.44"
resolved "http://npm.yohops.com/yoho-node-lib/-/yoho-node-lib-0.6.44.tgz#7ede014f170c2a55840bfcf627cef5305111fedb"
dependencies:
dnscache "^1.0.1"
handlebars "^4.0.5"
influx-batch-sender "^0.1.7"
influx-batch-sender "=0.1.7"
lodash "^4.13.1"
lru-cache "^4.1.1"
md5 "^2.1.0"
... ...