-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support performance timer for more precise milliseconds #74
Conversation
e.g.: 1.375ms better than 1ms
Codecov Report
@@ Coverage Diff @@
## master #74 +/- ##
==========================================
+ Coverage 97.36% 97.39% +0.02%
==========================================
Files 14 14
Lines 456 461 +5
Branches 72 73 +1
==========================================
+ Hits 444 449 +5
Misses 12 12
Continue to review full report at Codecov.
|
detail see eggjs/egg-logger#74 How to use: ```js // config.js exports.logger = { enablePerformanceTimer: true, }; ```
// Starting... | ||
// 10 tests completed. | ||
|
||
// logger.error(err) x 378,794 ops/sec ±1.35% (91 runs sampled) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
只要升级 node 到 16,性能就翻倍。
detail see eggjs/egg-logger#74 before: ```log [query] [1] DROP TABLE IF EXISTS `clients` ``` after: ```log [query] [1.478] DROP TABLE IF EXISTS `clients` ```
detail see eggjs/egg-logger#74 before: ```log [query] [1] DROP TABLE IF EXISTS `clients` ``` after: ```log [query] [1.478] DROP TABLE IF EXISTS `clients` ```
detail see eggjs/egg-logger#74 before: ```log [query] [1] DROP TABLE IF EXISTS `clients` ``` after: ```log [query] [1.478] DROP TABLE IF EXISTS `clients` ```
detail see eggjs/egg-logger#74 before: ```log [query] [1] DROP TABLE IF EXISTS `clients` ``` after: ```log [query] [1.478] DROP TABLE IF EXISTS `clients` ```
test/lib/egg/context_logger.test.js
Outdated
const m = body.match(/\/\d*ms/g); | ||
(parseInt(m[1].substring(1)) > parseInt(m[0].substring(1))).should.equal(true); | ||
const m = body.match(/\/\d+ms/g); | ||
console.log(m); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console
2.7.0 |
detail see eggjs/egg-logger#74 How to use: ```js // config.js exports.logger = { enablePerformanceTimer: true, }; ```
e.g.: 1.375ms better than 1ms
Checklist
npm test
passesAffected core subsystem(s)
Description of change