-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Perf Tests] Updates to perf test framework #12662
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
d732bd6
fix nodefetch test
HarshaNalluru 8859ebb
Add perf folder and download test
HarshaNalluru 016d7e8
perfstress-test:node command and rollup setup - currently results in …
HarshaNalluru 342ae51
formatting
HarshaNalluru 9a40172
Update main entry in perf package
HarshaNalluru 514c46f
Add "module": "commonjs"
HarshaNalluru 3a998c0
fix dotenv path
HarshaNalluru f6d0176
revert ts-config change and update perfstress-test:node
HarshaNalluru 0ddcea3
dotenv update
HarshaNalluru ab7868b
Revert "perfstress-test:node command and rollup setup - currently res…
HarshaNalluru 1f8b1a2
separate folders for track 1 and track 2
HarshaNalluru 38011a8
Update TOptionsNames to TOptions and changes to interfaces for better…
HarshaNalluru 012c6d5
update tests with the new changes to the src code.. left some TODOs
HarshaNalluru f626cfb
update package.json cmd from rushx to npm run
HarshaNalluru 367467b
download test updated - with the updated framework
HarshaNalluru 9eebb8b
Add global cleanup
HarshaNalluru 251caf8
minor update - no need for a new const blockBlobClient
HarshaNalluru f02c0c9
rest of the tests for storage-blob
HarshaNalluru 74d258b
split storage blob tests to a separate PR
HarshaNalluru 468b7cf
Act on TODOs
HarshaNalluru 602256f
do not "extends DefaultPerfStressOptions" for the constructor
HarshaNalluru f2efb1c
PerfStressPolicyTest fix accordingly
HarshaNalluru b6309db
remove <{}> with defaults.. everywhere
HarshaNalluru 118e18e
split storage changes to a separate PR
HarshaNalluru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,10 @@ | |
|
||
import { default as minimist, ParsedArgs as MinimistParsedArgs } from "minimist"; | ||
|
||
/** | ||
* Possible values for each PerfStress option | ||
*/ | ||
export type PerfStressOptionValue = string | number | boolean | undefined; | ||
|
||
/** | ||
* The structure of a PerfStress option. They represent command line parameters. | ||
*/ | ||
export interface PerfStressOption { | ||
export interface OptionDetails<TType> { | ||
/** | ||
* Whether the option is required or not. | ||
*/ | ||
|
@@ -30,14 +25,15 @@ export interface PerfStressOption { | |
longName?: string; | ||
/** | ||
* The default value that is going to be assigned to the option. | ||
* Expected: string | number | boolean | undefined | ||
*/ | ||
defaultValue?: PerfStressOptionValue; | ||
defaultValue?: TType; | ||
/** | ||
* The value specified by the user from the command line after either the shortName or the longName. | ||
* If no value was specified, the defaultValue will be used. | ||
* If the shortName or longName was specified, but no value was provided, "true" will be set. | ||
*/ | ||
value?: PerfStressOptionValue; | ||
value?: TType; | ||
/** | ||
* The description of each option. Descriptions of the assigned options will be shown at the beginning of the test call. | ||
* Descriptions of all the available options will be shown if the user sends either --help or -h. | ||
|
@@ -49,30 +45,33 @@ export interface PerfStressOption { | |
* A group of options is called PerfStressOptionDictionary, | ||
* and is shaped as a plain object to make it easier to access them. | ||
* | ||
* TNames defines the names of the options. This is necessary to allow TypeScript to suggest the appropriate names | ||
* for the options. | ||
* `keyof TOptions` provides the names of the options. This is necessary to allow TypeScript to suggest the appropriate names | ||
* for the options and parsedOptions. | ||
*/ | ||
export type PerfStressOptionDictionary<TNames extends string> = { | ||
[longName in TNames]: PerfStressOption; | ||
export type PerfStressOptionDictionary<TOptions = {}> = { | ||
[longName in keyof TOptions]: OptionDetails<TOptions[longName]>; | ||
}; | ||
|
||
/** | ||
* These are the default options longNames. | ||
* These represent the default options the tests can assume. | ||
* | ||
* @interface DefaultPerfStressOptions | ||
*/ | ||
export type DefaultPerfStressOptionNames = | ||
| "help" | ||
| "parallel" | ||
| "duration" | ||
| "warmup" | ||
| "iterations" | ||
| "no-cleanup" | ||
| "milliseconds-to-log" | ||
| "sync"; | ||
export interface DefaultPerfStressOptions { | ||
help: string; | ||
parallel: number; | ||
duration: number; | ||
warmup: number; | ||
iterations: number; | ||
"no-cleanup": boolean; | ||
"milliseconds-to-log": number; | ||
sync: boolean; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh cool!!! |
||
|
||
/** | ||
* These are the default options in full. | ||
*/ | ||
export const defaultPerfStressOptions: PerfStressOptionDictionary<DefaultPerfStressOptionNames> = { | ||
export const defaultPerfStressOptions: PerfStressOptionDictionary<DefaultPerfStressOptions> = { | ||
help: { | ||
description: "Shows all of the available options", | ||
shortName: "h" | ||
|
@@ -114,16 +113,18 @@ export const defaultPerfStressOptions: PerfStressOptionDictionary<DefaultPerfStr | |
/** | ||
* Parses the given options by extracting their values through `minimist`, or setting the default value defined in each option. | ||
* It also overwrites any present longName with the property name of each option. | ||
* | ||
* @param options A dictionary of options to parse using minimist. | ||
* @returns A new options dictionary. | ||
*/ | ||
export function parsePerfStressOption( | ||
options: PerfStressOptionDictionary<string> | ||
): PerfStressOptionDictionary<string> { | ||
export function parsePerfStressOption<TOptions>( | ||
options: PerfStressOptionDictionary<TOptions> | ||
): Required<PerfStressOptionDictionary<TOptions>> { | ||
const minimistResult: MinimistParsedArgs = minimist(process.argv); | ||
const result: PerfStressOptionDictionary<string> = {}; | ||
const result = {}; | ||
|
||
for (const longName of Object.keys(options)) { | ||
// This cast is needed since we're picking up options from process.argv | ||
const option = (options as any)[longName]; | ||
const { shortName, defaultValue, required } = option; | ||
const value = | ||
|
@@ -139,5 +140,5 @@ export function parsePerfStressOption( | |
}; | ||
} | ||
|
||
return result; | ||
return result as Required<PerfStressOptionDictionary<TOptions>>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
oh cool!