...
|
...
|
@@ -14,6 +14,13 @@ const TABLE = { |
|
|
REPORT: 'error-report'
|
|
|
};
|
|
|
|
|
|
const DB_NAME = 'web-apm';
|
|
|
|
|
|
const APP_NAME = {
|
|
|
pc: 'yohobuy-node',
|
|
|
h5: 'yohobuywap-node'
|
|
|
};
|
|
|
|
|
|
const profile_sql = {
|
|
|
duration() {
|
|
|
return SqlBuilder.of(TABLE.DURATION);
|
...
|
...
|
@@ -28,7 +35,7 @@ async function exec(sql) { |
|
|
return request.get(`${ENDPOINT}/query`)
|
|
|
.query({
|
|
|
q: sql,
|
|
|
db: 'web-apm'
|
|
|
db: DB_NAME
|
|
|
}).then(({body: result}) => {
|
|
|
const series = _.get(result, 'results[0].series[0]', {});
|
|
|
const col = _.get(series, 'columns', []);
|
...
|
...
|
@@ -42,8 +49,8 @@ async function exec(sql) { |
|
|
|
|
|
const APP = {
|
|
|
default: {field: '', op: '', value: ''},
|
|
|
pc: {field: 'app', op:'=', value: 'www.yohobuy.com'} ,
|
|
|
h5: {field: 'app', op: '=', value: 'm.yohobuy.com'}
|
|
|
pc: {field: 'app', op:'=', value: APP_NAME.pc},
|
|
|
h5: {field: 'app', op: '=', value: APP_NAME.h5}
|
|
|
};
|
|
|
|
|
|
const DURATION = {
|
...
|
...
|
|