-
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 15 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
67 changes: 67 additions & 0 deletions
67
sdk/storage/storage-blob/test/perfstress/track-2/download.spec.ts
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
import { | ||
PerfStressTest, | ||
PerfStressOptionDictionary, | ||
DefaultPerfStressOptions | ||
} from "@azure/test-utils-perfstress"; | ||
|
||
import { BlobServiceClient, StorageSharedKeyCredential } from "../../../src"; | ||
|
||
// Expects the .env file at the same level as the "test" folder | ||
import * as dotenv from "dotenv"; | ||
dotenv.config(); | ||
|
||
interface StorageBlobDownloadTestOptions extends DefaultPerfStressOptions { | ||
size: number; | ||
} | ||
|
||
const account = process.env.ACCOUNT_NAME || ""; | ||
const accountKey = process.env.ACCOUNT_KEY || ""; | ||
|
||
const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey); | ||
|
||
const blobServiceClient = new BlobServiceClient( | ||
// When using AnonymousCredential, following url should include a valid SAS or support public access | ||
`https://${account}.blob.core.windows.net`, | ||
sharedKeyCredential | ||
); | ||
const containerName = `newcontainer${new Date().getTime()}`; | ||
const blobName = `newblob${new Date().getTime()}`; | ||
const containerClient = blobServiceClient.getContainerClient(containerName); | ||
const blockBlobClient = blobServiceClient | ||
.getContainerClient(containerName) | ||
.getBlockBlobClient(blobName); | ||
|
||
export class StorageBlobDownloadTest extends PerfStressTest<StorageBlobDownloadTestOptions> { | ||
public options: PerfStressOptionDictionary<StorageBlobDownloadTestOptions> = { | ||
size: { | ||
required: true, | ||
description: "Required option", | ||
shortName: "sz", | ||
longName: "size", | ||
defaultValue: 10 | ||
} | ||
}; | ||
|
||
public async globalSetup() { | ||
const createContainerResponse = await containerClient.create(); | ||
console.log( | ||
`Create container ${containerName} successfully`, | ||
createContainerResponse.requestId | ||
); | ||
|
||
// Create a blob | ||
const blockBlobClient = containerClient.getBlockBlobClient(blobName); | ||
const uploadBlobResponse = await blockBlobClient.upload( | ||
Buffer.alloc(this.options.size.value!), | ||
this.options.size.value as number | ||
); | ||
console.log(`Upload block blob ${blobName} successfully`, uploadBlobResponse.requestId); | ||
} | ||
|
||
async runAsync(): Promise<void> { | ||
await blockBlobClient.download(0); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
sdk/storage/storage-blob/test/perfstress/track-2/index.spec.ts
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; | ||
import { StorageBlobDownloadTest } from "./download.spec"; | ||
|
||
console.log("=== Starting the perfStress test ==="); | ||
|
||
const perfStressProgram = new PerfStressProgram(selectPerfStressTest([StorageBlobDownloadTest])); | ||
|
||
perfStressProgram.run(); |
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!!!