Showing
1 changed file
with
10 additions
and
3 deletions
@@ -14,6 +14,13 @@ const TABLE = { | @@ -14,6 +14,13 @@ const TABLE = { | ||
14 | REPORT: 'error-report' | 14 | REPORT: 'error-report' |
15 | }; | 15 | }; |
16 | 16 | ||
17 | +const DB_NAME = 'web-apm'; | ||
18 | + | ||
19 | +const APP_NAME = { | ||
20 | + pc: 'yohobuy-node', | ||
21 | + h5: 'yohobuywap-node' | ||
22 | +}; | ||
23 | + | ||
17 | const profile_sql = { | 24 | const profile_sql = { |
18 | duration() { | 25 | duration() { |
19 | return SqlBuilder.of(TABLE.DURATION); | 26 | return SqlBuilder.of(TABLE.DURATION); |
@@ -28,7 +35,7 @@ async function exec(sql) { | @@ -28,7 +35,7 @@ async function exec(sql) { | ||
28 | return request.get(`${ENDPOINT}/query`) | 35 | return request.get(`${ENDPOINT}/query`) |
29 | .query({ | 36 | .query({ |
30 | q: sql, | 37 | q: sql, |
31 | - db: 'web-apm' | 38 | + db: DB_NAME |
32 | }).then(({body: result}) => { | 39 | }).then(({body: result}) => { |
33 | const series = _.get(result, 'results[0].series[0]', {}); | 40 | const series = _.get(result, 'results[0].series[0]', {}); |
34 | const col = _.get(series, 'columns', []); | 41 | const col = _.get(series, 'columns', []); |
@@ -42,8 +49,8 @@ async function exec(sql) { | @@ -42,8 +49,8 @@ async function exec(sql) { | ||
42 | 49 | ||
43 | const APP = { | 50 | const APP = { |
44 | default: {field: '', op: '', value: ''}, | 51 | default: {field: '', op: '', value: ''}, |
45 | - pc: {field: 'app', op:'=', value: 'www.yohobuy.com'} , | ||
46 | - h5: {field: 'app', op: '=', value: 'm.yohobuy.com'} | 52 | + pc: {field: 'app', op:'=', value: APP_NAME.pc}, |
53 | + h5: {field: 'app', op: '=', value: APP_NAME.h5} | ||
47 | }; | 54 | }; |
48 | 55 | ||
49 | const DURATION = { | 56 | const DURATION = { |
-
Please register or login to post a comment