test load

This commit is contained in:
2025-01-13 14:26:15 +03:00
parent da60eb27f9
commit e266761bbd
7 changed files with 131 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
using System.Diagnostics;
using System.Reflection;
using mROA.Implementation;
using mROA.Test;
namespace mROA.Performance;
class Program
{
private static ProgramlyInteractionChanel _interactionModule;
private static ISerialisationModule _serialisationModule;
private static IExecuteModule _executeModule;
private static IMethodRepository _methodRepository;
private static IContextRepository _contextRepository;
static void Main(string[] args)
{
_interactionModule = new ProgramlyInteractionChanel();
_serialisationModule = new JsonSerialisationModule(_interactionModule);
var repo = new MethodRepository();
repo.CollectForAssembly(Assembly.GetAssembly(typeof(ITestController)));
_methodRepository = repo;
var repo2 = new ContextRepository();
repo2.FillSingletons(Assembly.GetAssembly(typeof(ITestController)));
_contextRepository = repo2;
_executeModule = new PrepairedExecutionModule(_methodRepository, _serialisationModule, _contextRepository);
var sw = Stopwatch.StartNew();
_interactionModule.PassCommand(132, """
{
"RequestTypeId": 0,
"CommandId": 3
}
""");
while (_interactionModule.OutputBuffer.Count != 2) ;
// _interactionModule.PassCommand(132, """
// {
// "RequestTypeId": 0,
// "CommandId": 3
// }
// """);
// while (_interactionModule.OutputBuffer.Count() != 4) ;
var time = sw.Elapsed;
Console.WriteLine(time.TotalMilliseconds.ToString());
}
}
+15
View File
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\mROA.Test\mROA.Test.csproj" />
<ProjectReference Include="..\mROA\mROA.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("mROA.Performance")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+da60eb27f99600ee3a9ee8526d2b26260efd8225")]
[assembly: System.Reflection.AssemblyProductAttribute("mROA.Performance")]
[assembly: System.Reflection.AssemblyTitleAttribute("mROA.Performance")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Создано классом WriteCodeFragment MSBuild.
@@ -0,0 +1,15 @@
is_global = true
build_property.TargetFramework = net9.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = mROA.Performance
build_property.ProjectDir = C:\Users\Mimm\Projects\VisualStudioProjects\mROA\mROA.Performance\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 9.0
build_property.EnableCodeStyleSeverity =
@@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Mimm\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.10.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Mimm\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgNUnit_Analyzers Condition=" '$(PkgNUnit_Analyzers)' == '' ">C:\Users\Mimm\.nuget\packages\nunit.analyzers\4.3.0</PkgNUnit_Analyzers>
</PropertyGroup>
</Project>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />