-
Notifications
You must be signed in to change notification settings - Fork 558
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 wcfcore perf testing and deploy service with corewcf #4884
base: main
Are you sure you want to change the base?
Conversation
The WCFCorePerf and WCFCorePerfService is duplicate with the desktop version. What about rename WCFCorePerfService to CoreWCFService, and WCFCorePerf to WCFCorePerfClientUsingCoreWCFService (you could omit Service)? |
|
This PR looks like it has a lot of other unrelated changes included in it that were already merged. It's making it really difficult to review. Can you rebase to main? |
c8aac8d
to
c7d5bf1
Compare
I have rebased main and do a force push |
@@ -2,7 +2,7 @@ jobs: | |||
WCFCorePerf: | |||
source: | |||
repository: https://github.com/dotnet/wcf.git | |||
branchOrCommit: master | |||
branchOrCommit: main |
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.
These two changes aren't related with using CoreWCF as server, correct?
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.
These two changes aren't related with using CoreWCF as server, correct?
You are right, that means the client code will pull from main branch
...eModel/tests/Benchmarks/PerfUsingCoreWCFService/CoreWCFPerfService/CoreWCFPerfService.csproj
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,15 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
|
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.
Use the Sdk ""Microsoft.NET.Sdk.Web"
and remove the package reference to Microsoft.AspNetCore
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.
If change to "Microsoft.NET.Sdk.Web", visualstudio will throw IndexOutOfRangeException exception
...erviceModel/tests/Benchmarks/PerfUsingCoreWCFService/CoreWCFPerfService/MyCustomValidator.cs
Show resolved
Hide resolved
static void Main(string[] args) | ||
{ | ||
string filePath = Path.Combine(Environment.CurrentDirectory, "WCFCorePerfService.exe"); | ||
Console.WriteLine(filePath); |
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.
I think a better option is Assembly.GetEntryAssembly().Location
as the exe doesn't need to be launched from the current directory.
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.
Assembly.GetEntryAssembly().Location will return the full path of coreWCFPerfService.dll. but I need to get the full path of exe and add into firewall
string filePath = Path.Combine(Environment.CurrentDirectory, "WCFCorePerfService.exe"); | ||
Console.WriteLine(filePath); | ||
string command = $" advfirewall firewall add rule name=\"WCFCorePerfService\" dir=in protocol=any action=allow program=\"{filePath}\" enable=yes"; | ||
ExecuteCommand(command, Environment.CurrentDirectory, TimeSpan.FromSeconds(20)); |
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.
A better option is to directly modify the firewall. You can find some old code which does this here. It's basically a helper class which uses the COM component for programming the firewall and includes automatic cleanup of process exit. I believe this will work now as there's COM support in recent versions of .NET.
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.
I have use COM to add rules in the firewall. but this only support in windows OS
...Private.ServiceModel/tests/Benchmarks/PerfUsingCoreWCFService/CoreWCFPerfService/SayHello.cs
Outdated
Show resolved
Hide resolved
...m.Private.ServiceModel/tests/Benchmarks/PerfUsingCoreWCFService/WCFCorePerfClient/Program.cs
Outdated
Show resolved
Hide resolved
...m.Private.ServiceModel/tests/Benchmarks/PerfUsingCoreWCFService/WCFCorePerfClient/Program.cs
Outdated
Show resolved
Hide resolved
...m.Private.ServiceModel/tests/Benchmarks/PerfUsingCoreWCFService/WCFCorePerfClient/Program.cs
Outdated
Show resolved
Hide resolved
...m.Private.ServiceModel/tests/Benchmarks/PerfUsingCoreWCFService/WCFCorePerfClient/Program.cs
Outdated
Show resolved
Hide resolved
|
||
BenchmarksEventSource.Measure("wcfcoreperf/requests", request); | ||
BenchmarksEventSource.Measure("wcfcoreperf/rps/max", request / test._paramPerfMeasurementDuration.TotalSeconds); | ||
break; |
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.
The value you are dividing by is the wrong one. The total time taken will always be more than the specified duration time by an average of half the average request time. You need to measure the actual duration taken to complete the while loop and divide by that.
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.
I used EndTime-BeginTime , and found the value is equal to the specified duration. Maybe something wrong in the code
...iceModel/tests/Benchmarks/PerfUsingCoreWCFService/WCFCorePerfClient/WCFCorePerfClient.csproj
Outdated
Show resolved
Hide resolved
My understanding was we weren't going to be downloading anything any more and would always compile the perf crank service fresh each time. Refers to: src/System.Private.ServiceModel/tests/Benchmarks/PerfUsingNetfxWCFService/NetfxWCFPerfService/Program.cs:35 in c7d5bf1. [](commit_id = c7d5bf1, deletion_comment = False) |
@mconnew Crank only support .netcore and cannot build projects which target with .netframework. so I use download way to start service. do you know other way to host .netframewrok service? |
Add perf testing with crank and deploy new service with corewcf. @HongGit @mconnew