@@ -14,6 +14,11 @@ namespace JT808.DotNetty.CleintBenchmark.Configs | |||||
/// 5000ms毫秒 | /// 5000ms毫秒 | ||||
/// </summary> | /// </summary> | ||||
public int Interval { get; set; } = 5000; | public int Interval { get; set; } = 5000; | ||||
/// <summary> | |||||
/// 需要多台机器同时访问,那么可以根据这个避开重复终端号 | |||||
/// 100000-200000-300000 | |||||
/// </summary> | |||||
public int DeviceTemplate { get; set; } = 0; | |||||
public ClientBenchmarkOptions Value =>this; | public ClientBenchmarkOptions Value =>this; | ||||
} | } | ||||
} | } |
@@ -2,7 +2,7 @@ | |||||
<PropertyGroup> | <PropertyGroup> | ||||
<OutputType>Exe</OutputType> | <OutputType>Exe</OutputType> | ||||
<TargetFramework>netcoreapp3.0</TargetFramework> | |||||
<TargetFramework>netcoreapp3.1</TargetFramework> | |||||
<LangVersion>7.3</LangVersion> | <LangVersion>7.3</LangVersion> | ||||
</PropertyGroup> | </PropertyGroup> | ||||
@@ -51,7 +51,7 @@ namespace JT808.DotNetty.CleintBenchmark.Services | |||||
{ | { | ||||
taskFactory.StartNew((item) => | taskFactory.StartNew((item) => | ||||
{ | { | ||||
var client = jT808TcpClientFactory.Create(new JT808DeviceConfig(((int)item+1).ToString(), clientBenchmarkOptions.IP, clientBenchmarkOptions.Port)); | |||||
var client = jT808TcpClientFactory.Create(new JT808DeviceConfig(((int)item+1+ clientBenchmarkOptions.DeviceTemplate).ToString(), clientBenchmarkOptions.IP, clientBenchmarkOptions.Port)); | |||||
int lat = new Random(1000).Next(100000, 180000); | int lat = new Random(1000).Next(100000, 180000); | ||||
int Lng = new Random(1000).Next(100000, 180000); | int Lng = new Random(1000).Next(100000, 180000); | ||||
while (!cts.IsCancellationRequested) | while (!cts.IsCancellationRequested) | ||||
@@ -15,6 +15,7 @@ | |||||
"ClientBenchmarkOptions": { | "ClientBenchmarkOptions": { | ||||
"IP": "", | "IP": "", | ||||
"Port": 808, | "Port": 808, | ||||
"DeviceCount": 1 | |||||
"DeviceCount": 100, | |||||
"DeviceTemplate": 300000 //需要多台机器同时访问,那么可以根据这个避开重复终端号 100000-200000-300000 | |||||
} | } | ||||
} | } |