Skip to content

Commit

Permalink
✨ 增加api统计队列名称设置rtsQueueName
Browse files Browse the repository at this point in the history
  • Loading branch information
kongnet committed Jan 10, 2020
1 parent 57dc0b9 commit 46cedc1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [0.1.72](https://github.com/kongnet/skybase/compare/v0.1.71...v0.1.72) (2020-01-10)


### :sparkles:

* 更新的统计到mq的方法 ([a0ea9b3](https://github.com/kongnet/skybase/commit/a0ea9b3f8c139281f5c8ae2973cdcd4299165488))



## [0.1.71](https://github.com/kongnet/skybase/compare/v0.1.69...v0.1.71) (2020-01-03)


Expand Down
6 changes: 5 additions & 1 deletion lib/middleware/sky-api-register.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const fs = require('fs')
const path = require('path')
const $ = require('meeko')
const Mock = require('mockjs')
const SkyConfig = require('../../skyconfig')
Mock.Random.extend($.Mock)
const mockFn = {
noMock () {
Expand Down Expand Up @@ -194,7 +195,10 @@ const limitReqAction = (action, apiPath) => {
method: ['count', 'max', 'min', 'avg'],
time: +$.now()
}
global.rtsMQ.send({ queueName: 'rts', text: JSON.stringify(mqObj) })
global.rtsMQ.send({
queueName: SkyConfig.rtsQueueName + '_rts',
text: JSON.stringify(mqObj)
})
})
} else if (global.rts) {
// add stack
Expand Down
13 changes: 8 additions & 5 deletions skyconfig.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// 这里存的是默认配置,使用该框架前,可以考虑把这里的配置拷贝出去,也可以只拷贝需要覆盖的配置。
const path = require('path')
module.exports = {

/**
* 项目名称,启动时,会以3D字体的形式在控制台打印
* */
Expand Down Expand Up @@ -123,9 +122,13 @@ module.exports = {
jsonLimit: '2mb', // body中json格式大小限制
textLimit: '2mb', //
extendTypes: {
custom: [
'text/xml'
]
custom: ['text/xml']
}
}
},

/**
* rts queueName名称
* */

rtsQueueName: 'skybaseRtsQueueName'
}

0 comments on commit 46cedc1

Please sign in to comment.