Skip to content

common class for server run command build #4851

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

VincentBu
Copy link
Contributor

Between GCPerfSim running on the aspnet machines and the ASP.NET benchmarks, there is a lot of common functionality. The "ServerRun.CommandBuilder.cs" provides a common class to be used between the two.

@shimingsg shimingsg requested a review from Copilot May 22, 2025 00:52
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a shared ServerRunCommandBuilder to centralize generation of key-value arguments for server runs and refactors both GCPerfSim and ASP.NET benchmark command builders to use this new helper instead of manual string concatenation.

  • Added ServerRunCommandBuilder with methods for building parameter lists (config, scenario, env vars, trace, uploads, etc.).
  • Updated GCPerfSimCommandBuilder and ASPNetBenchmarksCommandBuilder to assemble crank arguments via the shared builder.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/benchmarks/gc/GC.Infrastructure/GC.Infrastructure.Core/CommandBuilders/ServerRun.CommandBuilder.cs New static helper for building key/value argument lists
src/benchmarks/gc/GC.Infrastructure/GC.Infrastructure.Core/CommandBuilders/GCPerfSim.CommandBuilder.cs Refactored to use ServerRunCommandBuilder for config, env vars, parameters, trace, upload, and profile
src/benchmarks/gc/GC.Infrastructure/GC.Infrastructure.Core/CommandBuilders/ASPNetBenchmarks.CommandBuilder.cs Refactored to use ServerRunCommandBuilder for environment, logging, trace, config, and overrides
Comments suppressed due to low confidence (2)

src/benchmarks/gc/GC.Infrastructure/GC.Infrastructure.Core/CommandBuilders/ServerRun.CommandBuilder.cs:46

  • [nitpick] There's a typo in the method name: 'GenerateKeyValuePairListFoParameters' should be 'GenerateKeyValuePairListForParameters' for consistency and clarity.
public static List<KeyValuePair<string, string>> GenerateKeyValuePairListFoParameters(Dictionary<string, string> parameters)

src/benchmarks/gc/GC.Infrastructure/GC.Infrastructure.Core/CommandBuilders/GCPerfSim.CommandBuilder.cs:96

  • The variable serverName is not defined in this scope. It should reference the actual profile name (e.g., run.Key or another existing variable).
ServerRunCommandBuilder.GenerateKeyValuePairListForProfile(serverName)

baseKVPList.Add(item);
}

return kvpList;
Copy link
Preview

Copilot AI May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method builds and mutates baseKVPList but then returns the original kvpList, so overrides are never applied. Consider applying removals/additions to kvpList or returning the mutated baseKVPList.

Suggested change
return kvpList;
return baseKVPList;

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant