fix tabbing
This commit is contained in:
parent
036b50b979
commit
4d96d858a5
54
main.cpp
54
main.cpp
@ -71,33 +71,33 @@ auto execute_as_client(std::string ipaddress, std::uint16_t port)
|
||||
for(int i = 0; i < num_clients; ++i)
|
||||
{
|
||||
threads.emplace_back(std::thread([&]()
|
||||
{
|
||||
client net_client{};
|
||||
metrics::time_tracker clock{};
|
||||
//Callback
|
||||
net_client.message_received += [&](std::string& message)
|
||||
{
|
||||
auto elapsed = clock.elapsed<double, std::milli>();
|
||||
auto client_num = this_job.client_metrics.size()+1;
|
||||
//UX
|
||||
sscout << client_num << math::numerical_suffix(client_num) << " client response\n"
|
||||
<< message
|
||||
<< "Round Trip Was " << elapsed.count() << " ms\n"
|
||||
<< hr;
|
||||
//Metrics
|
||||
metrics::client_message client_metric{};
|
||||
client_metric.client_number = client_num;
|
||||
client_metric.trip_time = elapsed.count();
|
||||
this_job.client_metrics.emplace_back(client_metric); //this isn't thread safe!
|
||||
return true;
|
||||
};
|
||||
auto res = net_client.connect(ipaddress, port);
|
||||
if (res.joinable())
|
||||
{
|
||||
net_client.send_message(std::to_string(operation));
|
||||
res.join();
|
||||
}
|
||||
}));
|
||||
{
|
||||
client net_client{};
|
||||
metrics::time_tracker clock{};
|
||||
//Callback
|
||||
net_client.message_received += [&](std::string& message)
|
||||
{
|
||||
auto elapsed = clock.elapsed<double, std::milli>();
|
||||
auto client_num = this_job.client_metrics.size()+1;
|
||||
//UX
|
||||
sscout << client_num << math::numerical_suffix(client_num) << " client response\n"
|
||||
<< message
|
||||
<< "Round Trip Was " << elapsed.count() << " ms\n"
|
||||
<< hr;
|
||||
//Metrics
|
||||
metrics::client_message client_metric{};
|
||||
client_metric.client_number = client_num;
|
||||
client_metric.trip_time = elapsed.count();
|
||||
this_job.client_metrics.emplace_back(client_metric); //this isn't thread safe!
|
||||
return true;
|
||||
};
|
||||
auto res = net_client.connect(ipaddress, port);
|
||||
if (res.joinable())
|
||||
{
|
||||
net_client.send_message(std::to_string(operation));
|
||||
res.join();
|
||||
}
|
||||
}));
|
||||
}
|
||||
sscout << "All clients connected.\n" << hr;
|
||||
for(auto&& thread : threads)
|
||||
|
Loading…
Reference in New Issue
Block a user