From 84e861ba35aa853bcf00898fb38805a7427956fb Mon Sep 17 00:00:00 2001 From: Jimmy Date: Mon, 19 Sep 2022 05:13:59 +0800 Subject: [PATCH 1/2] version1 --- SchedulingPractice.SubWorkerRunner/Program.cs | 1 + .../SchedulingPractice.SubWorkerRunner.csproj | 1 + SchedulingPractice.sln | 14 ++- .../JimSubWorkerBackgroundService.cs | 103 ++++++++++++++++++ SubWorker.JimDemo/Program.cs | 25 +++++ SubWorker.JimDemo/SubWorker.JimDemo.csproj | 15 +++ init.cmd | 20 ++++ jimdemo.cmd | 26 +++++ jimdemowork1.cmd | 23 ++++ 9 files changed, 226 insertions(+), 2 deletions(-) create mode 100644 SubWorker.JimDemo/JimSubWorkerBackgroundService.cs create mode 100644 SubWorker.JimDemo/Program.cs create mode 100644 SubWorker.JimDemo/SubWorker.JimDemo.csproj create mode 100644 init.cmd create mode 100644 jimdemo.cmd create mode 100644 jimdemowork1.cmd diff --git a/SchedulingPractice.SubWorkerRunner/Program.cs b/SchedulingPractice.SubWorkerRunner/Program.cs index ea5924b..2e51048 100644 --- a/SchedulingPractice.SubWorkerRunner/Program.cs +++ b/SchedulingPractice.SubWorkerRunner/Program.cs @@ -50,6 +50,7 @@ static void Main(string[] args) }); } else if (mode == "acetaxxxx") services.AddHostedService(); + else if (mode == "jim") services.AddHostedService(); else { throw new ArgumentOutOfRangeException($"Mode: {mode} not is not valid."); } }) .Build(); diff --git a/SchedulingPractice.SubWorkerRunner/SchedulingPractice.SubWorkerRunner.csproj b/SchedulingPractice.SubWorkerRunner/SchedulingPractice.SubWorkerRunner.csproj index dfad027..3834677 100644 --- a/SchedulingPractice.SubWorkerRunner/SchedulingPractice.SubWorkerRunner.csproj +++ b/SchedulingPractice.SubWorkerRunner/SchedulingPractice.SubWorkerRunner.csproj @@ -14,6 +14,7 @@ + diff --git a/SchedulingPractice.sln b/SchedulingPractice.sln index 10fa63e..93e918b 100644 --- a/SchedulingPractice.sln +++ b/SchedulingPractice.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29215.179 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32819.101 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SchedulingPractice.Core", "SchedulingPractice.Core\SchedulingPractice.Core.csproj", "{4E411DD0-16E8-4BD9-BA79-D22D1F4FE9B1}" EndProject @@ -14,6 +14,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution database.sql = database.sql demo-all.cmd = demo-all.cmd demo.cmd = demo.cmd + init.cmd = init.cmd + jimdemo.cmd = jimdemo.cmd + jimdemowork1.cmd = jimdemowork1.cmd README.md = README.md statistics.sql = statistics.sql EndProjectSection @@ -36,6 +39,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SubWorker.AndyDemo", "SubWo EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SchedulingPractice.SubWorkerRunner", "SchedulingPractice.SubWorkerRunner\SchedulingPractice.SubWorkerRunner.csproj", "{5D349423-56A0-4E03-A59F-7D1AF95B78E7}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubWorker.JimDemo", "SubWorker.JimDemo\SubWorker.JimDemo.csproj", "{8CCFCDE5-71A0-4935-8B69-9CAB71931065}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -86,6 +91,10 @@ Global {5D349423-56A0-4E03-A59F-7D1AF95B78E7}.Debug|Any CPU.Build.0 = Debug|Any CPU {5D349423-56A0-4E03-A59F-7D1AF95B78E7}.Release|Any CPU.ActiveCfg = Release|Any CPU {5D349423-56A0-4E03-A59F-7D1AF95B78E7}.Release|Any CPU.Build.0 = Release|Any CPU + {8CCFCDE5-71A0-4935-8B69-9CAB71931065}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8CCFCDE5-71A0-4935-8B69-9CAB71931065}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8CCFCDE5-71A0-4935-8B69-9CAB71931065}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8CCFCDE5-71A0-4935-8B69-9CAB71931065}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -99,6 +108,7 @@ Global {7D80EF21-E6C8-46EC-8179-67D328B15335} = {5A225F28-B864-4306-B0C7-83D9CBDABF5B} {32F4B1E1-4A5B-4695-9BCD-1A76F8566420} = {5A225F28-B864-4306-B0C7-83D9CBDABF5B} {29711E67-24F9-4736-AAC8-BBE6831A4DEF} = {5A225F28-B864-4306-B0C7-83D9CBDABF5B} + {8CCFCDE5-71A0-4935-8B69-9CAB71931065} = {5A225F28-B864-4306-B0C7-83D9CBDABF5B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {43B102A2-F68E-4926-9EAA-6763FDDEF0B4} diff --git a/SubWorker.JimDemo/JimSubWorkerBackgroundService.cs b/SubWorker.JimDemo/JimSubWorkerBackgroundService.cs new file mode 100644 index 0000000..5227259 --- /dev/null +++ b/SubWorker.JimDemo/JimSubWorkerBackgroundService.cs @@ -0,0 +1,103 @@ +using Microsoft.Extensions.Hosting; +using SchedulingPractice.Core; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace SubWorker.JimDemo +{ + public class JimSubWorkerBackgroundService : BackgroundService + { + private readonly BlockingCollection _queue = new BlockingCollection(); + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + await Task.Delay(1); + //平行處理 + Thread[] threads = new Thread[5]; + for (int i = 0; i < threads.Length; i++) + { + threads[i] = new Thread(Worker); + threads[i].Start(); + } + + + Stopwatch timer = new Stopwatch(); + + using (JobsRepo repo = new JobsRepo()) + { + if (!stoppingToken.IsCancellationRequested) + { + timer.Restart(); + var allReadyJobs = repo.GetReadyJobs(); + if (allReadyJobs != null) + { + foreach (var allReadyJob in allReadyJobs) + { + if (!stoppingToken.IsCancellationRequested) + { + //降低Lock次數 + if (repo.GetJob(allReadyJob.Id).State != 0) + { + Console.Write("%"); + continue; + } + //鎖定 + if (!repo.AcquireJobLock(allReadyJob.Id)) + { + Console.Write("X"); + continue; + } + _queue.Add(allReadyJob); + } + else + { + goto shutdown; + } + } + + try + { + await Task.Delay((int)Math.Max((JobSettings.MinPrepareTime - timer.Elapsed).TotalMilliseconds, 0), stoppingToken); + } + catch (TaskCanceledException) + { + goto shutdown; + } + } + } + shutdown: + _queue.CompleteAdding(); + } + foreach (var thead in threads) + { + thead.Join(); + } + Console.WriteLine($"- shutdown event detected, stop worker service..."); + } + private async void Worker() + { + using (JobsRepo repo = new JobsRepo()) + { + foreach (JobInfo job in this._queue.GetConsumingEnumerable()) + { + //判斷Lock之後,是否可立即執行 + if (job.RunAt > DateTime.Now) + { + Console.Write("@"); + await Task.Delay(job.RunAt - DateTime.Now); + continue; + } + repo.ProcessLockedJob(job.Id); + Console.Write("O"); + } + } + + + } + } +} diff --git a/SubWorker.JimDemo/Program.cs b/SubWorker.JimDemo/Program.cs new file mode 100644 index 0000000..f8709ec --- /dev/null +++ b/SubWorker.JimDemo/Program.cs @@ -0,0 +1,25 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace SubWorker.JimDemo +{ + class Program + { + static void Main(string[] args) + { + var host = new HostBuilder() + .ConfigureServices((context, services) => + { + services.AddHostedService(); + }) + .Build(); + + using (host) + { + host.Start(); + host.WaitForShutdown(); + } + } + } +} diff --git a/SubWorker.JimDemo/SubWorker.JimDemo.csproj b/SubWorker.JimDemo/SubWorker.JimDemo.csproj new file mode 100644 index 0000000..15e9084 --- /dev/null +++ b/SubWorker.JimDemo/SubWorker.JimDemo.csproj @@ -0,0 +1,15 @@ + + + + Exe + netcoreapp2.2 + + + + + + + + + + diff --git a/init.cmd b/init.cmd new file mode 100644 index 0000000..89aece5 --- /dev/null +++ b/init.cmd @@ -0,0 +1,20 @@ +cls +set RUNNER=jim + +set SINCE=30 +set DURATION=600 +set TOTAL_DURATION=660 +set STATISTIC_CSV=%CD%\logs\statistics.csv + +mkdir logs +del /f logs\result-%RUNNER%-*.txt + + + + +set MODE=HATEST + +dotnet SchedulingPractice.PubWorker\bin\Debug\netcoreapp2.2\SchedulingPractice.PubWorker.dll %SINCE% %DURATION% %RUNNER% %MODE% %STATISTIC_CSV% > logs\result-%RUNNER%-%MODE%.txt +powershell sleep 30 + +:end \ No newline at end of file diff --git a/jimdemo.cmd b/jimdemo.cmd new file mode 100644 index 0000000..87e6bb1 --- /dev/null +++ b/jimdemo.cmd @@ -0,0 +1,26 @@ +cls +set RUNNER=jim + +set SINCE=30 +set DURATION=600 +set TOTAL_DURATION=660 +set STATISTIC_CSV=%CD%\logs\statistics.csv + +mkdir logs +del /f logs\result-%RUNNER%-*.txt + + + + +set MODE=HATEST +start /min dotnet SchedulingPractice.SubWorkerRunner\bin\Debug\netcoreapp2.2\SchedulingPractice.SubWorkerRunner.dll %RUNNER% 10 30 %TOTAL_DURATION% +start /min dotnet SchedulingPractice.SubWorkerRunner\bin\Debug\netcoreapp2.2\SchedulingPractice.SubWorkerRunner.dll %RUNNER% 10 30 %TOTAL_DURATION% +start /min dotnet SchedulingPractice.SubWorkerRunner\bin\Debug\netcoreapp2.2\SchedulingPractice.SubWorkerRunner.dll %RUNNER% 10 30 %TOTAL_DURATION% +start /min dotnet SchedulingPractice.SubWorkerRunner\bin\Debug\netcoreapp2.2\SchedulingPractice.SubWorkerRunner.dll %RUNNER% 10 30 %TOTAL_DURATION% +start /min dotnet SchedulingPractice.SubWorkerRunner\bin\Debug\netcoreapp2.2\SchedulingPractice.SubWorkerRunner.dll %RUNNER% 10 30 %TOTAL_DURATION% + +dotnet SchedulingPractice.PubWorker\bin\Debug\netcoreapp2.2\SchedulingPractice.PubWorker.dll %SINCE% %DURATION% %RUNNER% %MODE% %STATISTIC_CSV% > logs\result-%RUNNER%-%MODE%.txt +powershell sleep 30 + + +:end \ No newline at end of file diff --git a/jimdemowork1.cmd b/jimdemowork1.cmd new file mode 100644 index 0000000..e36d0b9 --- /dev/null +++ b/jimdemowork1.cmd @@ -0,0 +1,23 @@ +cls +set RUNNER=jim + +set SINCE=30 +set DURATION=600 +set TOTAL_DURATION=660 +set STATISTIC_CSV=%CD%\logs\statistics.csv + +mkdir logs +del /f logs\result-%RUNNER%-*.txt + + +set MODE=WORKERS01 + +start /min dotnet SchedulingPractice.SubWorkerRunner\bin\Debug\netcoreapp2.2\SchedulingPractice.SubWorkerRunner.dll %RUNNER% 0 0 %TOTAL_DURATION% + +dotnet SchedulingPractice.PubWorker\bin\Debug\netcoreapp2.2\SchedulingPractice.PubWorker.dll %SINCE% %DURATION% %RUNNER% %MODE% %STATISTIC_CSV% > logs\result-%RUNNER%-%MODE%.txt +powershell sleep 30 + + + + +:end \ No newline at end of file From 6231bb4962c652ad82974a6c256e746509d33873 Mon Sep 17 00:00:00 2001 From: "KUNYOUTECH\\jim_lin" Date: Mon, 19 Sep 2022 17:38:20 +0800 Subject: [PATCH 2/2] version2 --- SchedulingPractice.sln | 9 +- .../JimSubWorkerBackgroundService.cs | 82 +++++++------------ SubWorker.JimDemo/Program.cs | 59 +++++++++++++ init.cmd | 20 ----- jimdemo.cmd | 26 ------ jimdemowork1.cmd | 23 ------ 6 files changed, 95 insertions(+), 124 deletions(-) delete mode 100644 init.cmd delete mode 100644 jimdemo.cmd delete mode 100644 jimdemowork1.cmd diff --git a/SchedulingPractice.sln b/SchedulingPractice.sln index 93e918b..2a12853 100644 --- a/SchedulingPractice.sln +++ b/SchedulingPractice.sln @@ -11,13 +11,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SubWorker.AndrewDemo", "Sub EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{927CF37F-7C8C-426E-B63C-1121CA9FE062}" ProjectSection(SolutionItems) = preProject + andrew0928demoworker.cmd = andrew0928demoworker.cmd + andydemoworker.cmd = andydemoworker.cmd database.sql = database.sql demo-all.cmd = demo-all.cmd demo.cmd = demo.cmd init.cmd = init.cmd - jimdemo.cmd = jimdemo.cmd - jimdemowork1.cmd = jimdemowork1.cmd README.md = README.md + jimdemoall.cmd = jimdemoall.cmd + jimdemoha.cmd = jimdemoha.cmd + jimdemoworker.cmd = jimdemoworker.cmd statistics.sql = statistics.sql EndProjectSection EndProject @@ -39,7 +42,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SubWorker.AndyDemo", "SubWo EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SchedulingPractice.SubWorkerRunner", "SchedulingPractice.SubWorkerRunner\SchedulingPractice.SubWorkerRunner.csproj", "{5D349423-56A0-4E03-A59F-7D1AF95B78E7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubWorker.JimDemo", "SubWorker.JimDemo\SubWorker.JimDemo.csproj", "{8CCFCDE5-71A0-4935-8B69-9CAB71931065}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SubWorker.JimDemo", "SubWorker.JimDemo\SubWorker.JimDemo.csproj", "{8CCFCDE5-71A0-4935-8B69-9CAB71931065}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/SubWorker.JimDemo/JimSubWorkerBackgroundService.cs b/SubWorker.JimDemo/JimSubWorkerBackgroundService.cs index 5227259..0c77835 100644 --- a/SubWorker.JimDemo/JimSubWorkerBackgroundService.cs +++ b/SubWorker.JimDemo/JimSubWorkerBackgroundService.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.Hosting; using SchedulingPractice.Core; using System; +using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; @@ -13,91 +14,68 @@ namespace SubWorker.JimDemo { public class JimSubWorkerBackgroundService : BackgroundService { - private readonly BlockingCollection _queue = new BlockingCollection(); - protected override async Task ExecuteAsync(CancellationToken stoppingToken) + private BlockingCollection _queue = new BlockingCollection(); + protected async override Task ExecuteAsync(CancellationToken stoppingToken) { await Task.Delay(1); - //平行處理 - Thread[] threads = new Thread[5]; - for (int i = 0; i < threads.Length; i++) + List tasks = new List(); + for (int i = 0; i < 5; i++) { - threads[i] = new Thread(Worker); - threads[i].Start(); + Task task = Task.Run(() => Worker()); + tasks.Add(task); } - Stopwatch timer = new Stopwatch(); using (JobsRepo repo = new JobsRepo()) { - if (!stoppingToken.IsCancellationRequested) + while (stoppingToken.IsCancellationRequested == false) { timer.Restart(); - var allReadyJobs = repo.GetReadyJobs(); - if (allReadyJobs != null) + Console.WriteLine($"[T: {Thread.CurrentThread.ManagedThreadId}] fetch available jobs from repository..."); + + foreach (var job in repo.GetReadyJobs(JobSettings.MinPrepareTime)) { - foreach (var allReadyJob in allReadyJobs) + if (stoppingToken.IsCancellationRequested == false) { - if (!stoppingToken.IsCancellationRequested) + if (repo.GetJob(job.Id).State == 0) { - //降低Lock次數 - if (repo.GetJob(allReadyJob.Id).State != 0) + if (repo.AcquireJobLock(job.Id)) { - Console.Write("%"); - continue; + if (job.RunAt > DateTime.Now) + { + await Task.Delay(job.RunAt - DateTime.Now); + } + _queue.Add(job); } - //鎖定 - if (!repo.AcquireJobLock(allReadyJob.Id)) - { - Console.Write("X"); - continue; - } - _queue.Add(allReadyJob); - } - else - { - goto shutdown; } } - - try + } + + if (stoppingToken.IsCancellationRequested == false) + { + if(JobSettings.MinPrepareTime > timer.Elapsed) { await Task.Delay((int)Math.Max((JobSettings.MinPrepareTime - timer.Elapsed).TotalMilliseconds, 0), stoppingToken); } - catch (TaskCanceledException) - { - goto shutdown; - } } } - shutdown: _queue.CompleteAdding(); + Task.WaitAll(tasks.ToArray()); } - foreach (var thead in threads) - { - thead.Join(); - } - Console.WriteLine($"- shutdown event detected, stop worker service..."); + Console.WriteLine($"[T: {Thread.CurrentThread.ManagedThreadId}] shutdown background services..."); } - private async void Worker() + private void Worker() { using (JobsRepo repo = new JobsRepo()) { - foreach (JobInfo job in this._queue.GetConsumingEnumerable()) + foreach (var job in this._queue.GetConsumingEnumerable()) { - //判斷Lock之後,是否可立即執行 - if (job.RunAt > DateTime.Now) - { - Console.Write("@"); - await Task.Delay(job.RunAt - DateTime.Now); - continue; - } repo.ProcessLockedJob(job.Id); - Console.Write("O"); + Console.WriteLine($"[T: {Thread.CurrentThread.ManagedThreadId}] process job({job.Id}) with delay {(DateTime.Now - job.RunAt).TotalMilliseconds} msec..."); } + Console.WriteLine($"[T: {Thread.CurrentThread.ManagedThreadId}] process worker thread was terminated..."); } - - } } } diff --git a/SubWorker.JimDemo/Program.cs b/SubWorker.JimDemo/Program.cs index f8709ec..5decd91 100644 --- a/SubWorker.JimDemo/Program.cs +++ b/SubWorker.JimDemo/Program.cs @@ -23,3 +23,62 @@ static void Main(string[] args) } } } +/* <<< Best Performance : 1 Process >>> +Jobs Scheduling Metrics: + +--(action count)---------------------------------------------- +- CREATE: 1767 +- ACQUIRE_SUCCESS: 1767 +- ACQUIRE_FAILURE: 0 +- COMPLETE: 1767 +- QUERYJOB: 1767 +- QUERYLIST: 66 + +--(state count)---------------------------------------------- +- COUNT(CREATE): 0 +- COUNT(LOCK): 0 +- COUNT(COMPLETE): 1767 + +--(statistics)---------------------------------------------- +- DELAY(Average): 189 +- DELAY(Stdev): 113.67526669485 + +--(test result)---------------------------------------------- +- Complete Job: True, 1767 / 1767 +- Delay Too Long: 0 +- Fail Job: True, 0 + +--(benchmark score)---------------------------------------------- +- Exec Cost Score: 8367 (querylist x 100 + acquire-failure x 10 + queryjob x 1) +- Efficient Score: 302.68 (average + stdev) +*/ +/* <<< High Availability : 5 Process >>> +Jobs Scheduling Metrics: + +--(action count)---------------------------------------------- +- CREATE: 1752 +- ACQUIRE_SUCCESS: 1752 +- ACQUIRE_FAILURE: 1598 +- COMPLETE: 1752 +- QUERYJOB: 6069 +- QUERYLIST: 314 + +--(state count)---------------------------------------------- +- COUNT(CREATE): 0 +- COUNT(LOCK): 0 +- COUNT(COMPLETE): 1752 + +--(statistics)---------------------------------------------- +- DELAY(Average): 141 +- DELAY(Stdev): 134.610298136809 + +--(test result)---------------------------------------------- +- Complete Job: True, 1752 / 1752 +- Delay Too Long: 0 +- Fail Job: True, 0 + +--(benchmark score)---------------------------------------------- +- Exec Cost Score: 53449 (querylist x 100 + acquire-failure x 10 + queryjob x 1) +- Efficient Score: 275.61 (average + stdev) + +*/ diff --git a/init.cmd b/init.cmd deleted file mode 100644 index 89aece5..0000000 --- a/init.cmd +++ /dev/null @@ -1,20 +0,0 @@ -cls -set RUNNER=jim - -set SINCE=30 -set DURATION=600 -set TOTAL_DURATION=660 -set STATISTIC_CSV=%CD%\logs\statistics.csv - -mkdir logs -del /f logs\result-%RUNNER%-*.txt - - - - -set MODE=HATEST - -dotnet SchedulingPractice.PubWorker\bin\Debug\netcoreapp2.2\SchedulingPractice.PubWorker.dll %SINCE% %DURATION% %RUNNER% %MODE% %STATISTIC_CSV% > logs\result-%RUNNER%-%MODE%.txt -powershell sleep 30 - -:end \ No newline at end of file diff --git a/jimdemo.cmd b/jimdemo.cmd deleted file mode 100644 index 87e6bb1..0000000 --- a/jimdemo.cmd +++ /dev/null @@ -1,26 +0,0 @@ -cls -set RUNNER=jim - -set SINCE=30 -set DURATION=600 -set TOTAL_DURATION=660 -set STATISTIC_CSV=%CD%\logs\statistics.csv - -mkdir logs -del /f logs\result-%RUNNER%-*.txt - - - - -set MODE=HATEST -start /min dotnet SchedulingPractice.SubWorkerRunner\bin\Debug\netcoreapp2.2\SchedulingPractice.SubWorkerRunner.dll %RUNNER% 10 30 %TOTAL_DURATION% -start /min dotnet SchedulingPractice.SubWorkerRunner\bin\Debug\netcoreapp2.2\SchedulingPractice.SubWorkerRunner.dll %RUNNER% 10 30 %TOTAL_DURATION% -start /min dotnet SchedulingPractice.SubWorkerRunner\bin\Debug\netcoreapp2.2\SchedulingPractice.SubWorkerRunner.dll %RUNNER% 10 30 %TOTAL_DURATION% -start /min dotnet SchedulingPractice.SubWorkerRunner\bin\Debug\netcoreapp2.2\SchedulingPractice.SubWorkerRunner.dll %RUNNER% 10 30 %TOTAL_DURATION% -start /min dotnet SchedulingPractice.SubWorkerRunner\bin\Debug\netcoreapp2.2\SchedulingPractice.SubWorkerRunner.dll %RUNNER% 10 30 %TOTAL_DURATION% - -dotnet SchedulingPractice.PubWorker\bin\Debug\netcoreapp2.2\SchedulingPractice.PubWorker.dll %SINCE% %DURATION% %RUNNER% %MODE% %STATISTIC_CSV% > logs\result-%RUNNER%-%MODE%.txt -powershell sleep 30 - - -:end \ No newline at end of file diff --git a/jimdemowork1.cmd b/jimdemowork1.cmd deleted file mode 100644 index e36d0b9..0000000 --- a/jimdemowork1.cmd +++ /dev/null @@ -1,23 +0,0 @@ -cls -set RUNNER=jim - -set SINCE=30 -set DURATION=600 -set TOTAL_DURATION=660 -set STATISTIC_CSV=%CD%\logs\statistics.csv - -mkdir logs -del /f logs\result-%RUNNER%-*.txt - - -set MODE=WORKERS01 - -start /min dotnet SchedulingPractice.SubWorkerRunner\bin\Debug\netcoreapp2.2\SchedulingPractice.SubWorkerRunner.dll %RUNNER% 0 0 %TOTAL_DURATION% - -dotnet SchedulingPractice.PubWorker\bin\Debug\netcoreapp2.2\SchedulingPractice.PubWorker.dll %SINCE% %DURATION% %RUNNER% %MODE% %STATISTIC_CSV% > logs\result-%RUNNER%-%MODE%.txt -powershell sleep 30 - - - - -:end \ No newline at end of file