Skip to content
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

Add configuration variables. #109907

Merged
merged 8 commits into from
Nov 26, 2024

Conversation

WangyangZhou90
Copy link
Contributor

Adding the GC Configurations to logs at the start of the test by calling GC.GetConfigurationVariables().

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Nov 18, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/gc
See info in area-owners.md if you want to be subscribed.

@@ -157,9 +157,20 @@ public static int Main(string[] args)
string configFile = null;
bool okToContinue = true, doReplay = false;
string sTests = "tests", sSeed = "seed", exectime = "maximumExecutionTime";
string output = "";
Copy link
Member

Choose a reason for hiding this comment

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

Making use of StringBuilder here. https://learn.microsoft.com/en-us/dotnet/standard/base-types/stringbuilder

StringBuilder sb = new()
...

// To Add..
sb.AppendLine($"{kvp.Key}: {kvp.Value}");

...
// To Log..
rf._logger.WriteToInstrumentationLog(null, LoggingLevels.StartupShutdown, String.Format("Get GC Configuration Variables\n{0}",output.ToString()));

Copy link
Member

Choose a reason for hiding this comment

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

or perhaps don't bother with output at all and just write the lines one at the time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mrsharm I have updated the source with using StringBuilder.

Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>
Copy link
Member

@mrsharm mrsharm left a comment

Choose a reason for hiding this comment

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

LGTM!

@mrsharm mrsharm merged commit 89adcf9 into dotnet:main Nov 26, 2024
70 checks passed
mikelle-rogers pushed a commit to mikelle-rogers/runtime that referenced this pull request Dec 10, 2024
* Add GC configuration to log

* Add GC configuration to log

* Code modification after review

* Code modification after review

* Update src/tests/GC/Stress/Framework/ReliabilityFramework.cs

Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>

---------

Co-authored-by: Mukund Raghav Sharma (Moko) <68247673+mrsharm@users.noreply.github.com>
Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-GC-coreclr community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants