forked from ddrilling/AsbCloudServer
fix ControllerLoadTester requests.
This commit is contained in:
parent
8e6384e46c
commit
cc9896c062
@ -33,20 +33,13 @@ namespace AsbCloudDevOperations
|
|||||||
|
|
||||||
private async Task SendRequestsAsync(int i, CancellationToken token)
|
private async Task SendRequestsAsync(int i, CancellationToken token)
|
||||||
{
|
{
|
||||||
var json = JsonSerializer.Serialize(new List<TelemetryDataSaubDto>()
|
|
||||||
{
|
|
||||||
new TelemetryDataSaubDto()
|
|
||||||
});
|
|
||||||
|
|
||||||
var stringContent = new StringContent(json, Encoding.UTF8,
|
|
||||||
"application/json");
|
|
||||||
|
|
||||||
var uid = $"123123_1";
|
var uid = $"123123_1";
|
||||||
|
|
||||||
Console.WriteLine($"Sending telemetry info with uid: {uid}");
|
Console.WriteLine($"Sending telemetry info with uid: {uid}");
|
||||||
|
|
||||||
var tInfoUri = new Uri($"http://localhost:5000/api/telemetry/{uid}/info");
|
var tInfoUri = new Uri($"http://localhost:5000/api/telemetry/{uid}/info");
|
||||||
var infoResponse = await client.PostAsync(tInfoUri, stringContent, token);
|
var infoResponse = await client.PostAsync(tInfoUri, MakeTelemetryInfoContent(), token);
|
||||||
|
|
||||||
Console.WriteLine($"Передана telemetry info с: {infoResponse.StatusCode}");
|
Console.WriteLine($"Передана telemetry info с: {infoResponse.StatusCode}");
|
||||||
|
|
||||||
@ -54,10 +47,31 @@ namespace AsbCloudDevOperations
|
|||||||
{
|
{
|
||||||
await Task.Delay(rand.Next(1000, 5000), token);
|
await Task.Delay(rand.Next(1000, 5000), token);
|
||||||
var dataSaubUri = new Uri($"http://localhost:5000/api/telemetryDataSaub/{uid}");
|
var dataSaubUri = new Uri($"http://localhost:5000/api/telemetryDataSaub/{uid}");
|
||||||
var saubResponse = await client.PostAsync(dataSaubUri, stringContent, token);
|
var saubResponse = await client.PostAsync(dataSaubUri, MakeDataSaubContent(), token);
|
||||||
|
|
||||||
Console.WriteLine(saubResponse.StatusCode);
|
Console.WriteLine(saubResponse.StatusCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static StringContent MakeTelemetryInfoContent()
|
||||||
|
{
|
||||||
|
var json = JsonSerializer.Serialize(new TelemetryInfoDto{ Cluster = "Cluster" });
|
||||||
|
|
||||||
|
var stringContent = new StringContent(json, Encoding.UTF8,
|
||||||
|
"application/json");
|
||||||
|
return stringContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static StringContent MakeDataSaubContent()
|
||||||
|
{
|
||||||
|
var json = JsonSerializer.Serialize(new List<TelemetryDataSaubDto>()
|
||||||
|
{
|
||||||
|
new TelemetryDataSaubDto()
|
||||||
|
});
|
||||||
|
|
||||||
|
var stringContent = new StringContent(json, Encoding.UTF8,
|
||||||
|
"application/json");
|
||||||
|
return stringContent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user