create-perf-test
Skill887 starsChanged 29 days agoMITView on GitHub
Generate a new performance test
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- eng/tools/generate_api/AGENTS.mdAGENTS.md
- samples/AGENTS.mdAGENTS.md
- sdk/core/AGENTS.mdAGENTS.md
- sdk/cosmos/AGENTS.mdAGENTS.md
- sdk/cosmos/azure_data_cosmos_emulator/AGENTS.mdAGENTS.md
- sdk/cosmos/docs/AGENTS.mdAGENTS.md
- agentic-workflowsSkill
- analyze-codeSkill
- check-spellingSkill
- create-crateSkill
- create-hotfixSkill
- create-recorded-testSkill
- document-cratesSkill
- export-apiSkill
- lint-markdownSkill
- prepare-releaseSkill
- review-doc-commentsSkill
- update-emitterSkill
- update-rustSkill
- cosmos-design-structSkill
- cosmos-pre-commit-validationSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 0 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 40
Add a type that implements azure_core_test::perf::PerfTest.
- Very specific: line 42
Use sdk/storage/azure_storage_blob/perf/list_blob_test.rs as an example.
- Very specific: line 45
If credentials are needed, prefer the crate's existing perf-test pattern (for example context.recording().credential() or an existing …
- Very specific: line 46
If the client has options, instrument them with recording.instrument_perf(&mut options.client_options)?
- Very specific: line 51
Add a top-level Tests: property if it does not already exist.
- Very specific: line 52
Add the following YAML under the Tests: property as a separate YAML array object:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Generate a new performance test
You will generate a new performance (perf) test under the sdk/{service-directory}/{crate-name}/perf directory as ${input:testName:perf_test_name}.rs where:
{service-directory}is the directory name under sdk for the current ${file} e.g.,core.{crate-name}is the crate directory name undersdk/{service-directory}for the current ${file} e.g.,azure_core.
Set up
These instructions only need to be done once. If changes described are already present, do not make the changes again.
Under the
{crate-name}directory, inCargo.tomladd the following section:[[bench]] name = "perf" path = "perf/perf_tests.rs" harness = false- Under the
{crate-name}directory, add aperf/perf_tests.rsfile that usesazure_core_test::perf::PerfRunnerto register and run the crate's perf tests. - Under the
{crate-name}directory, copy sdk/core/perf.yml and change only the following contents:- Change
ServiceDirectoryto match the{service-directory}.
- Change
- Under the
{crate-name}directory, copy sdk/core/perf-tests.yml and change only the following contents:- Change
Serviceto match the{service-directory}. - Change
Projectto match the{crate-name}. - Change the
PackageVersionsto replaceazure_corewith the{crate-name}.
- Change
Adding a new perf test
For each new perf test:
- In
sdk/{service-directory}/{crate-name}/perf/${input:testName}.rs:- Add a type that implements
azure_core_test::perf::PerfTest. - Generate a perf test for the currently selected function in ${file} or specified client method name, if any.
- Use sdk/storage/azure_storage_blob/perf/list_blob_test.rs as an example.
- Define a
test_metadata()function returningPerfTestMetadata, including any required command-line options. - Separate setup, the measured operation, and cleanup in the
PerfTestimplementation. - If credentials are needed, prefer the crate's existing perf-test pattern (for example
context.recording().credential()or an existing helper) instead of introducing a new authentication flow. - If the client has options, instrument them with
recording.instrument_perf(&mut options.client_options)?.
- Add a type that implements
- In
sdk/{service-directory}/{crate-name}/perf/perf_tests.rs:- Add
mod ${input:testName};. - Register the new test metadata with
PerfRunner::new(...).
- Add
- In the
{crate-name}/perf-tests.ymlfile:- Add a top-level
Tests:property if it does not already exist. Add the following YAML under the
Tests:property as a separate YAML array object:- Test: ${input:testName} Class: ${input:testName} Arguments: - --sync
- Add a top-level
- Match existing crate patterns for client construction, shared setup state, and environment variable names.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

