Add Tests to measure activation times of extension#1813
Conversation
| console.log(`Analysis Engine Loaded in ${analysisEngineActivationAvgTime}ms`); | ||
|
|
||
| expect(devActivationAvgTime - releaseActivationAvgTime).to.be.lessThan(AllowedIncreaaseInActivationDelayInMS, 'Activation times have increased above allowed threshold.'); | ||
| expect(devActivationAvgTime).to.be.lessThan(1000, 'Activation time has exceed 1s.'); |
There was a problem hiding this comment.
With analysis engine may be a bit more than a second, depends on the machine/VM.
| import { commands, extensions } from 'vscode'; | ||
| import { StopWatch } from '../../client/common/stopWatch'; | ||
|
|
||
| const AllowedIncreaaseInActivationDelayInMS = 50; |
| For Extension activation times, we load both extensions x times, and re-load the window y times in each x load. | ||
| I.e. capture averages by giving the extensions sufficient time to warm up. | ||
| This block of code merely launches the tests by using either the dev or release version of the extension, | ||
| and spawning the tests (mimic user starting tests from command line), this way we can run tests multiple times. |
There was a problem hiding this comment.
We can also set a maximum perf number to help deal with skew, e.g. we never want this to average above 500 ms and we fail if that occurs. This prevents drift by saying we allow up to a 10% shift by being absolute instead of relative. It would also potentially negate needing to do a comparison against a current version.
Codecov Report
@@ Coverage Diff @@
## master #1813 +/- ##
==========================================
- Coverage 74.37% 74.32% -0.06%
==========================================
Files 282 282
Lines 13218 13191 -27
Branches 2375 2346 -29
==========================================
- Hits 9831 9804 -27
Misses 3256 3256
Partials 131 131
Continue to review full report at Codecov.
|
1927481 to
3707b2c
Compare
c85a3cd to
f05e27a
Compare
Fixes #932
This pull request: