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.DependencyInjection; |
|||
|
|||
namespace Volo.ClientSimulation.Demo |
|||
namespace Volo.ClientSimulation.Demo; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
public class BrandingProvider : DefaultBrandingProvider |
|||
{ |
|||
[Dependency(ReplaceServices = true)] |
|||
public class BrandingProvider : DefaultBrandingProvider |
|||
{ |
|||
public override string AppName => "Client Simulation"; |
|||
} |
|||
public override string AppName => "Client Simulation"; |
|||
} |
|||
|
|||
@ -1,13 +1,12 @@ |
|||
using Microsoft.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.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; |
|||
|
|||
namespace Volo.ClientSimulation |
|||
namespace Volo.ClientSimulation; |
|||
|
|||
public class ClientSimulationOptions |
|||
{ |
|||
public class ClientSimulationOptions |
|||
{ |
|||
public List<ScenarioConfiguration> Scenarios { get; } |
|||
public List<ScenarioConfiguration> Scenarios { get; } |
|||
|
|||
public ClientSimulationOptions() |
|||
{ |
|||
Scenarios = new List<ScenarioConfiguration>(); |
|||
} |
|||
public ClientSimulationOptions() |
|||
{ |
|||
Scenarios = new List<ScenarioConfiguration>(); |
|||
} |
|||
} |
|||
|
|||
@ -1,9 +1,8 @@ |
|||
namespace Volo.ClientSimulation.Clients |
|||
namespace Volo.ClientSimulation.Clients; |
|||
|
|||
public enum ClientState |
|||
{ |
|||
public enum ClientState |
|||
{ |
|||
Stopped, |
|||
Running, |
|||
Stopping |
|||
} |
|||
} |
|||
Stopped, |
|||
Running, |
|||
Stopping |
|||
} |
|||
|
|||
@ -1,19 +1,18 @@ |
|||
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( |
|||
Type scenarioType, |
|||
int clientCount = 1) |
|||
{ |
|||
ScenarioType = scenarioType; |
|||
ClientCount = clientCount; |
|||
} |
|||
public ScenarioConfiguration( |
|||
Type scenarioType, |
|||
int clientCount = 1) |
|||
{ |
|||
ScenarioType = scenarioType; |
|||
ClientCount = clientCount; |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,23 +1,22 @@ |
|||
using System; |
|||
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) |
|||
{ |
|||
ServiceProvider = serviceProvider; |
|||
Properties = new Dictionary<string, object>(); |
|||
} |
|||
public ScenarioExecutionContext(IServiceProvider serviceProvider) |
|||
{ |
|||
ServiceProvider = serviceProvider; |
|||
Properties = new Dictionary<string, object>(); |
|||
} |
|||
|
|||
public virtual void Reset() |
|||
{ |
|||
Properties.Clear(); |
|||
} |
|||
public virtual void Reset() |
|||
{ |
|||
Properties.Clear(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,29 +1,28 @@ |
|||
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( |
|||
string name, |
|||
int duration = 1000) |
|||
{ |
|||
Name = name; |
|||
Duration = duration; |
|||
} |
|||
public SleepScenarioStep( |
|||
string name, |
|||
int duration = 1000) |
|||
{ |
|||
Name = name; |
|||
Duration = duration; |
|||
} |
|||
|
|||
protected override Task ExecuteAsync(ScenarioExecutionContext context) |
|||
{ |
|||
return Task.Delay(Duration); |
|||
} |
|||
protected override Task ExecuteAsync(ScenarioExecutionContext context) |
|||
{ |
|||
return Task.Delay(Duration); |
|||
} |
|||
|
|||
public override string GetDisplayText() |
|||
{ |
|||
return base.GetDisplayText() + $" ({Name})"; |
|||
} |
|||
public override string GetDisplayText() |
|||
{ |
|||
return base.GetDisplayText() + $" ({Name})"; |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,10 +1,9 @@ |
|||
namespace Volo.ClientSimulation |
|||
namespace Volo.ClientSimulation; |
|||
|
|||
public enum SimulationState |
|||
{ |
|||
public enum SimulationState |
|||
{ |
|||
Stopped, |
|||
Starting, |
|||
Started, |
|||
Stopping |
|||
} |
|||
Stopped, |
|||
Starting, |
|||
Started, |
|||
Stopping |
|||
} |
|||
|
|||
@ -1,13 +1,12 @@ |
|||
using System; |
|||
using Volo.ClientSimulation.Clients; |
|||
|
|||
namespace Volo.ClientSimulation.Snapshot |
|||
namespace Volo.ClientSimulation.Snapshot; |
|||
|
|||
[Serializable] |
|||
public class ClientSnapshot |
|||
{ |
|||
[Serializable] |
|||
public class ClientSnapshot |
|||
{ |
|||
public ClientState State { get; set; } |
|||
public ClientState State { get; set; } |
|||
|
|||
public ScenarioSnapshot Scenario { get; set; } |
|||
} |
|||
} |
|||
public ScenarioSnapshot Scenario { get; set; } |
|||
} |
|||
|
|||
@ -1,15 +1,14 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.ClientSimulation.Snapshot |
|||
namespace Volo.ClientSimulation.Snapshot; |
|||
|
|||
[Serializable] |
|||
public class ScenarioSnapshot |
|||
{ |
|||
[Serializable] |
|||
public class ScenarioSnapshot |
|||
{ |
|||
public string DisplayText { get; set; } |
|||
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; |
|||
|
|||
namespace Volo.ClientSimulation.Snapshot |
|||
namespace Volo.ClientSimulation.Snapshot; |
|||
|
|||
[Serializable] |
|||
public class ScenarioStepSnapshot |
|||
{ |
|||
[Serializable] |
|||
public class ScenarioStepSnapshot |
|||
{ |
|||
public string DisplayText { get; set; } |
|||
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; |
|||
|
|||
namespace Volo.ClientSimulation.Snapshot |
|||
namespace Volo.ClientSimulation.Snapshot; |
|||
|
|||
[Serializable] |
|||
public class ScenarioStepSummarySnapshot |
|||
{ |
|||
[Serializable] |
|||
public class ScenarioStepSummarySnapshot |
|||
{ |
|||
public string DisplayText { get; set; } |
|||
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.Collections.Generic; |
|||
|
|||
namespace Volo.ClientSimulation.Snapshot |
|||
namespace Volo.ClientSimulation.Snapshot; |
|||
|
|||
[Serializable] |
|||
public class ScenarioSummarySnapshot |
|||
{ |
|||
[Serializable] |
|||
public class ScenarioSummarySnapshot |
|||
{ |
|||
public string DisplayText { get; set; } |
|||
public string DisplayText { get; set; } |
|||
|
|||
public List<ScenarioStepSummarySnapshot> Steps { get; set; } |
|||
} |
|||
} |
|||
public List<ScenarioStepSummarySnapshot> Steps { get; set; } |
|||
} |
|||
|
|||
Loading…
Reference in new issue