Skip to content

Commit fd873bf

Browse files
authored
Merge pull request #103 from adityapatwardhan/PerfTest
Performance Testing
2 parents 73d3ceb + 07f3e1b commit fd873bf

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
RFC:
3+
Author: Aditya Patwardhan
4+
Status: Draft
5+
SupercededBy:
6+
Version: 0.2
7+
Area: Testing
8+
Comments Due: 10/15/2017
9+
Plan to implement: Yes
10+
---
11+
12+
# Performance testing for PowerShell
13+
14+
This RFC proposes the plan to add AppInsights instrumentation to collect performance telemetry from daily CI runs.
15+
This RFC specifies the additional telemetry that will be added.
16+
17+
## Motivation
18+
19+
To validate the performance of PowerShell, we need to gather performance measurements at regular intervals.
20+
This will enable us in visualizing performance trends and help us identify performance regressions.
21+
22+
## Specification
23+
24+
This RFC proposes to add AppInsights telemetry data points to gather performance metrics.
25+
These metrics will be collected only during daily CI runs in AppVeyor and Travis CI.
26+
Typically, we would need large number of iterations to get stable numbers.
27+
A [metric aggregator](https://docs.microsoft.com/en-us/azure/application-insights/app-insights-api-custom-events-metrics#trackmetric) will be used to compose the data from iterations and then upload the telemetry data points.
28+
This will avoid throttling and dropping of events.
29+
30+
The metric collection code will be within a `#ifdef` and will only be compiled in when PowerShell is built with `Performance` configuration.
31+
There will be no performance metric collection code in official builds.
32+
33+
### Proposed performance test scenarios
34+
35+
* PowerShell startup time for cold and warm start.
36+
37+
* `Get-Command` for a particular module.
38+
39+
* `Get-Help` for non-existent command, about topic and cmdlet.
40+
41+
* `Import-Module` for script-based, binary modules.
42+
43+
* `Get-Module -ListAvailable` of a scoped PSModulePath constrained to test modules.
44+
45+
* Parsing of scripts, classes.
46+
47+
Telemetry events will be added to PowerShell code at appropriate locations to collect these metrics.
48+
Before recording data points, it will be verified that we are running a daily run in AppVeyor or Travis CI.
49+
PowerBI dashboard will be created to visualize the metrics.
50+
51+
### Environment
52+
53+
* PowerShell assemblies are CrossGen'ed.
54+
* PSModulePath will be scoped to performance test modules path.
55+
* Windows, Linux and MacOS have separate AppInsights streams, so they can be tracked separately.
56+
* All measurements will be for test artifacts to reduce variance due to product module changes.
57+
58+
## Alternate Proposals and Considerations
59+
60+
AppInsights was chosen to achieve cross platform compatibility.
61+
Another alternative would be to develop a framework to log metric as cross platform module.
62+
It would be lot of work to create a precise and reliable framework.
63+
64+
Defining goals for these metrics is out of scope for this RFC.
65+
66+
DotNet / CoreFX uses [xUnit performance framework](https://github.com/Microsoft/xunit-performance).
67+
It requires us the develop the tests in C# and hence we would have to use Powershell APIs to execute tests.
68+
The lowest granularity for measurement we get would be around `PowerShell.AddScript().Invoke()`.
69+
This would be too broad of a measurement and might hide the scenario under test.

0 commit comments

Comments
 (0)