mirror of
https://github.com/ceph/ceph
synced 2025-04-01 14:51:13 +00:00
Make anticipation_timeout configurable with config file
Signed-off-by: Taewoong Kim <taewoong.kim@sk.com>
This commit is contained in:
parent
2f06d632d5
commit
72e4df95cf
@ -130,6 +130,8 @@ int crimson::qos_simulation::parse_config_file(const std::string &fname, sim_con
|
||||
g_conf.server_random_selection = stobool(val);
|
||||
if (!cf.read("global", "server_soft_limit", val))
|
||||
g_conf.server_soft_limit = stobool(val);
|
||||
if (!cf.read("global", "anticipation_timeout", val))
|
||||
g_conf.anticipation_timeout = stod(val);
|
||||
|
||||
for (uint i = 0; i < g_conf.server_groups; i++) {
|
||||
srv_group_t st;
|
||||
|
@ -100,6 +100,7 @@ namespace crimson {
|
||||
uint client_groups;
|
||||
bool server_random_selection;
|
||||
bool server_soft_limit;
|
||||
double anticipation_timeout;
|
||||
|
||||
std::vector<cli_group_t> cli_group;
|
||||
std::vector<srv_group_t> srv_group;
|
||||
@ -107,11 +108,13 @@ namespace crimson {
|
||||
sim_config_t(uint _server_groups = 1,
|
||||
uint _client_groups = 1,
|
||||
bool _server_random_selection = false,
|
||||
bool _server_soft_limit = true) :
|
||||
bool _server_soft_limit = true,
|
||||
double _anticipation_timeout = 0.0) :
|
||||
server_groups(_server_groups),
|
||||
client_groups(_client_groups),
|
||||
server_random_selection(_server_random_selection),
|
||||
server_soft_limit(_server_soft_limit)
|
||||
server_soft_limit(_server_soft_limit),
|
||||
anticipation_timeout(_anticipation_timeout)
|
||||
{
|
||||
srv_group.reserve(server_groups);
|
||||
cli_group.reserve(client_groups);
|
||||
@ -123,7 +126,9 @@ namespace crimson {
|
||||
"server_groups = " << sim_config.server_groups << "\n" <<
|
||||
"client_groups = " << sim_config.client_groups << "\n" <<
|
||||
"server_random_selection = " << sim_config.server_random_selection << "\n" <<
|
||||
"server_soft_limit = " << sim_config.server_soft_limit;
|
||||
"server_soft_limit = " << sim_config.server_soft_limit << "\n" <<
|
||||
std::fixed << std::setprecision(3) <<
|
||||
"anticipation_timeout = " << sim_config.anticipation_timeout;
|
||||
return out;
|
||||
}
|
||||
}; // class sim_config_t
|
||||
|
@ -74,6 +74,7 @@ int main(int argc, char* argv[]) {
|
||||
const uint client_groups = g_conf.client_groups;
|
||||
const bool server_random_selection = g_conf.server_random_selection;
|
||||
const bool server_soft_limit = g_conf.server_soft_limit;
|
||||
const double anticipation_timeout = g_conf.anticipation_timeout;
|
||||
uint server_total_count = 0;
|
||||
uint client_total_count = 0;
|
||||
|
||||
@ -176,7 +177,11 @@ int main(int argc, char* argv[]) {
|
||||
test::CreateQueueF create_queue_f =
|
||||
[&](test::DmcQueue::CanHandleRequestFunc can_f,
|
||||
test::DmcQueue::HandleRequestFunc handle_f) -> test::DmcQueue* {
|
||||
return new test::DmcQueue(client_info_f, can_f, handle_f, server_soft_limit);
|
||||
return new test::DmcQueue(client_info_f,
|
||||
can_f,
|
||||
handle_f,
|
||||
server_soft_limit,
|
||||
anticipation_timeout);
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user