mirror of https://github.com/abpframework/abp.git
28 changed files with 647 additions and 651 deletions
@ -1,11 +1,10 @@ |
|||||
using Volo.Abp.Ui.Branding; |
using Volo.Abp.Ui.Branding; |
||||
using Volo.Abp.DependencyInjection; |
using Volo.Abp.DependencyInjection; |
||||
|
|
||||
namespace Volo.ClientSimulation.Demo |
namespace Volo.ClientSimulation.Demo; |
||||
|
|
||||
|
[Dependency(ReplaceServices = true)] |
||||
|
public class BrandingProvider : DefaultBrandingProvider |
||||
{ |
{ |
||||
[Dependency(ReplaceServices = true)] |
public override string AppName => "Client Simulation"; |
||||
public class BrandingProvider : DefaultBrandingProvider |
|
||||
{ |
|
||||
public override string AppName => "Client Simulation"; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,13 +1,12 @@ |
|||||
using Microsoft.AspNetCore.Mvc; |
using Microsoft.AspNetCore.Mvc; |
||||
using Volo.Abp.AspNetCore.Mvc; |
using Volo.Abp.AspNetCore.Mvc; |
||||
|
|
||||
namespace Volo.ClientSimulation.Demo.Controllers |
namespace Volo.ClientSimulation.Demo.Controllers; |
||||
|
|
||||
|
public class HomeController : AbpController |
||||
{ |
{ |
||||
public class HomeController : AbpController |
public ActionResult Index() |
||||
{ |
{ |
||||
public ActionResult Index() |
return Redirect("/ClientSimulation"); |
||||
{ |
|
||||
return Redirect("/ClientSimulation"); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,27 @@ |
|||||
|
{ |
||||
|
"iisSettings": { |
||||
|
"windowsAuthentication": false, |
||||
|
"anonymousAuthentication": true, |
||||
|
"iisExpress": { |
||||
|
"applicationUrl": "http://localhost:50482/", |
||||
|
"sslPort": 44319 |
||||
|
} |
||||
|
}, |
||||
|
"profiles": { |
||||
|
"IIS Express": { |
||||
|
"commandName": "IISExpress", |
||||
|
"launchBrowser": true, |
||||
|
"environmentVariables": { |
||||
|
"ASPNETCORE_ENVIRONMENT": "Development" |
||||
|
} |
||||
|
}, |
||||
|
"Volo.ClientSimulation.Web": { |
||||
|
"commandName": "Project", |
||||
|
"launchBrowser": true, |
||||
|
"environmentVariables": { |
||||
|
"ASPNETCORE_ENVIRONMENT": "Development" |
||||
|
}, |
||||
|
"applicationUrl": "https://localhost:5001;http://localhost:5000" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,13 +1,12 @@ |
|||||
using Volo.Abp.Http.Client.IdentityModel; |
using Volo.Abp.Http.Client.IdentityModel; |
||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
|
|
||||
namespace Volo.ClientSimulation |
namespace Volo.ClientSimulation; |
||||
|
|
||||
|
[DependsOn( |
||||
|
typeof(AbpHttpClientIdentityModelModule) |
||||
|
)] |
||||
|
public class ClientSimulationModule : AbpModule |
||||
{ |
{ |
||||
[DependsOn( |
|
||||
typeof(AbpHttpClientIdentityModelModule) |
|
||||
)] |
|
||||
public class ClientSimulationModule : AbpModule |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
|
|
||||
namespace Volo.ClientSimulation |
namespace Volo.ClientSimulation; |
||||
|
|
||||
|
public class ClientSimulationOptions |
||||
{ |
{ |
||||
public class ClientSimulationOptions |
public List<ScenarioConfiguration> Scenarios { get; } |
||||
{ |
|
||||
public List<ScenarioConfiguration> Scenarios { get; } |
|
||||
|
|
||||
public ClientSimulationOptions() |
public ClientSimulationOptions() |
||||
{ |
{ |
||||
Scenarios = new List<ScenarioConfiguration>(); |
Scenarios = new List<ScenarioConfiguration>(); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
namespace Volo.ClientSimulation.Clients |
namespace Volo.ClientSimulation.Clients; |
||||
|
|
||||
|
public enum ClientState |
||||
{ |
{ |
||||
public enum ClientState |
Stopped, |
||||
{ |
Running, |
||||
Stopped, |
Stopping |
||||
Running, |
} |
||||
Stopping |
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,19 +1,18 @@ |
|||||
using System; |
using System; |
||||
|
|
||||
namespace Volo.ClientSimulation |
namespace Volo.ClientSimulation; |
||||
|
|
||||
|
public class ScenarioConfiguration |
||||
{ |
{ |
||||
public class ScenarioConfiguration |
public Type ScenarioType { get; } |
||||
{ |
|
||||
public Type ScenarioType { get; } |
|
||||
|
|
||||
public int ClientCount { get; } |
public int ClientCount { get; } |
||||
|
|
||||
public ScenarioConfiguration( |
public ScenarioConfiguration( |
||||
Type scenarioType, |
Type scenarioType, |
||||
int clientCount = 1) |
int clientCount = 1) |
||||
{ |
{ |
||||
ScenarioType = scenarioType; |
ScenarioType = scenarioType; |
||||
ClientCount = clientCount; |
ClientCount = clientCount; |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,23 +1,22 @@ |
|||||
using System; |
using System; |
||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
|
|
||||
namespace Volo.ClientSimulation.Scenarios |
namespace Volo.ClientSimulation.Scenarios; |
||||
|
|
||||
|
public class ScenarioExecutionContext |
||||
{ |
{ |
||||
public class ScenarioExecutionContext |
public IServiceProvider ServiceProvider { get; } |
||||
{ |
|
||||
public IServiceProvider ServiceProvider { get; } |
|
||||
|
|
||||
public Dictionary<string, object> Properties { get; } |
public Dictionary<string, object> Properties { get; } |
||||
|
|
||||
public ScenarioExecutionContext(IServiceProvider serviceProvider) |
public ScenarioExecutionContext(IServiceProvider serviceProvider) |
||||
{ |
{ |
||||
ServiceProvider = serviceProvider; |
ServiceProvider = serviceProvider; |
||||
Properties = new Dictionary<string, object>(); |
Properties = new Dictionary<string, object>(); |
||||
} |
} |
||||
|
|
||||
public virtual void Reset() |
public virtual void Reset() |
||||
{ |
{ |
||||
Properties.Clear(); |
Properties.Clear(); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,29 +1,28 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
|
||||
namespace Volo.ClientSimulation.Scenarios |
namespace Volo.ClientSimulation.Scenarios; |
||||
|
|
||||
|
public class SleepScenarioStep : ScenarioStep |
||||
{ |
{ |
||||
public class SleepScenarioStep : ScenarioStep |
public string Name { get; } |
||||
{ |
|
||||
public string Name { get; } |
|
||||
|
|
||||
public int Duration { get; } |
public int Duration { get; } |
||||
|
|
||||
public SleepScenarioStep( |
public SleepScenarioStep( |
||||
string name, |
string name, |
||||
int duration = 1000) |
int duration = 1000) |
||||
{ |
{ |
||||
Name = name; |
Name = name; |
||||
Duration = duration; |
Duration = duration; |
||||
} |
} |
||||
|
|
||||
protected override Task ExecuteAsync(ScenarioExecutionContext context) |
protected override Task ExecuteAsync(ScenarioExecutionContext context) |
||||
{ |
{ |
||||
return Task.Delay(Duration); |
return Task.Delay(Duration); |
||||
} |
} |
||||
|
|
||||
public override string GetDisplayText() |
public override string GetDisplayText() |
||||
{ |
{ |
||||
return base.GetDisplayText() + $" ({Name})"; |
return base.GetDisplayText() + $" ({Name})"; |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
namespace Volo.ClientSimulation |
namespace Volo.ClientSimulation; |
||||
|
|
||||
|
public enum SimulationState |
||||
{ |
{ |
||||
public enum SimulationState |
Stopped, |
||||
{ |
Starting, |
||||
Stopped, |
Started, |
||||
Starting, |
Stopping |
||||
Started, |
|
||||
Stopping |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,13 +1,12 @@ |
|||||
using System; |
using System; |
||||
using Volo.ClientSimulation.Clients; |
using Volo.ClientSimulation.Clients; |
||||
|
|
||||
namespace Volo.ClientSimulation.Snapshot |
namespace Volo.ClientSimulation.Snapshot; |
||||
|
|
||||
|
[Serializable] |
||||
|
public class ClientSnapshot |
||||
{ |
{ |
||||
[Serializable] |
public ClientState State { get; set; } |
||||
public class ClientSnapshot |
|
||||
{ |
|
||||
public ClientState State { get; set; } |
|
||||
|
|
||||
public ScenarioSnapshot Scenario { get; set; } |
public ScenarioSnapshot Scenario { get; set; } |
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,15 +1,14 @@ |
|||||
using System; |
using System; |
||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
|
|
||||
namespace Volo.ClientSimulation.Snapshot |
namespace Volo.ClientSimulation.Snapshot; |
||||
|
|
||||
|
[Serializable] |
||||
|
public class ScenarioSnapshot |
||||
{ |
{ |
||||
[Serializable] |
public string DisplayText { get; set; } |
||||
public class ScenarioSnapshot |
|
||||
{ |
|
||||
public string DisplayText { get; set; } |
|
||||
|
|
||||
public List<ScenarioStepSnapshot> Steps { get; set; } |
public List<ScenarioStepSnapshot> Steps { get; set; } |
||||
|
|
||||
public ScenarioStepSnapshot CurrentStep { get; set; } |
public ScenarioStepSnapshot CurrentStep { get; set; } |
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,26 +1,25 @@ |
|||||
using System; |
using System; |
||||
|
|
||||
namespace Volo.ClientSimulation.Snapshot |
namespace Volo.ClientSimulation.Snapshot; |
||||
|
|
||||
|
[Serializable] |
||||
|
public class ScenarioStepSnapshot |
||||
{ |
{ |
||||
[Serializable] |
public string DisplayText { get; set; } |
||||
public class ScenarioStepSnapshot |
|
||||
{ |
|
||||
public string DisplayText { get; set; } |
|
||||
|
|
||||
public int ExecutionCount { get; set; } |
public int ExecutionCount { get; set; } |
||||
|
|
||||
public int SuccessCount { get; set; } |
public int SuccessCount { get; set; } |
||||
|
|
||||
public int FailCount { get; set; } |
public int FailCount { get; set; } |
||||
|
|
||||
public double AvgExecutionDuration { get; set; } |
public double AvgExecutionDuration { get; set; } |
||||
|
|
||||
public double TotalExecutionDuration { get; set; } |
public double TotalExecutionDuration { get; set; } |
||||
|
|
||||
public double MinExecutionDuration { get; set; } |
public double MinExecutionDuration { get; set; } |
||||
|
|
||||
public double MaxExecutionDuration { get; set; } |
public double MaxExecutionDuration { get; set; } |
||||
|
|
||||
public double LastExecutionDuration { get; set; } |
public double LastExecutionDuration { get; set; } |
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,24 +1,23 @@ |
|||||
using System; |
using System; |
||||
|
|
||||
namespace Volo.ClientSimulation.Snapshot |
namespace Volo.ClientSimulation.Snapshot; |
||||
|
|
||||
|
[Serializable] |
||||
|
public class ScenarioStepSummarySnapshot |
||||
{ |
{ |
||||
[Serializable] |
public string DisplayText { get; set; } |
||||
public class ScenarioStepSummarySnapshot |
|
||||
{ |
|
||||
public string DisplayText { get; set; } |
|
||||
|
|
||||
public int ExecutionCount { get; set; } |
public int ExecutionCount { get; set; } |
||||
|
|
||||
public int SuccessCount { get; set; } |
public int SuccessCount { get; set; } |
||||
|
|
||||
public int FailCount { get; set; } |
public int FailCount { get; set; } |
||||
|
|
||||
public double AvgExecutionDuration { get; set; } |
public double AvgExecutionDuration { get; set; } |
||||
|
|
||||
public double TotalExecutionDuration { get; set; } |
public double TotalExecutionDuration { get; set; } |
||||
|
|
||||
public double MinExecutionDuration { get; set; } |
public double MinExecutionDuration { get; set; } |
||||
|
|
||||
public double MaxExecutionDuration { get; set; } |
public double MaxExecutionDuration { get; set; } |
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,13 +1,12 @@ |
|||||
using System; |
using System; |
||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
|
|
||||
namespace Volo.ClientSimulation.Snapshot |
namespace Volo.ClientSimulation.Snapshot; |
||||
|
|
||||
|
[Serializable] |
||||
|
public class ScenarioSummarySnapshot |
||||
{ |
{ |
||||
[Serializable] |
public string DisplayText { get; set; } |
||||
public class ScenarioSummarySnapshot |
|
||||
{ |
|
||||
public string DisplayText { get; set; } |
|
||||
|
|
||||
public List<ScenarioStepSummarySnapshot> Steps { get; set; } |
public List<ScenarioStepSummarySnapshot> Steps { get; set; } |
||||
} |
} |
||||
} |
|
||||
|
|||||
Loading…
Reference in new issue