list<Client*> clients;
list<SyntheticClient*> synclients;
- Messenger* messengers[g_conf->num_client];
- MonClient* mclients[g_conf->num_client];
+ Messenger* messengers[num_client];
+ MonClient* mclients[num_client];
- cout << "ceph-syn: starting " << g_conf->num_client << " syn client(s)" << std::endl;
- for (int i=0; i<g_conf->num_client; i++) {
+ cout << "ceph-syn: starting " << num_client << " syn client(s)" << std::endl;
+ for (int i=0; i<num_client; i++) {
messengers[i] = Messenger::create_client_messenger(g_ceph_context,
"synclient");
messengers[i]->bind(g_conf->public_addr);
delete client;
}
- for (int i = 0; i < g_conf->num_client; ++i) {
+ for (int i = 0; i < num_client; ++i) {
// wait for messenger to finish
delete mclients[i];
messengers[i]->shutdown();
//void trace_include(SyntheticClient *syn, Client *cl, string& prefix);
//void trace_openssh(SyntheticClient *syn, Client *cl, string& prefix);
-
+int num_client = 1;
list<int> syn_modes;
list<int> syn_iargs;
list<string> syn_sargs;
vector<const char*> nargs;
for (unsigned i=0; i<args.size(); i++) {
+ if (strcmp(args[i],"--num-client") == 0) {
+ num_client = atoi(args[++i]);
+ continue;
+ }
if (strcmp(args[i],"--syn") == 0) {
++i;
int SyntheticClient::create_objects(int nobj, int osize, int inflight)
{
// divy up
- int numc = client->cct->_conf->num_client ? client->cct->_conf->num_client : 1;
+ int numc = num_client ? num_client : 1;
int start, inc, end;
if (sp < 0) dirnum++;
//dout(0) << "leading dir " << filename << " " << dirnum << dendl;
- if (dirnum % client->cct->_conf->num_client != client->get_nodeid()) {
+ if (dirnum % num_client != client->get_nodeid()) {
dout(20) << "skipping leading dir " << dirnum << " " << filename << dendl;
continue;
}
OPTION(cluster_addr, OPT_ADDR, entity_addr_t())
OPTION(public_network, OPT_STR, "")
OPTION(cluster_network, OPT_STR, "")
-OPTION(num_client, OPT_INT, 1)
OPTION(monmap, OPT_STR, "")
OPTION(mon_host, OPT_STR, "")
OPTION(mon_dns_srv_name, OPT_STR, "ceph-mon")
TEST(DaemonConfig, SimpleSet) {
int ret;
- ret = g_ceph_context->_conf->set_val("num_client", "21");
+ ret = g_ceph_context->_conf->set_val("log_graylog_port", "21");
ASSERT_EQ(ret, 0);
g_ceph_context->_conf->apply_changes(NULL);
char buf[128];
memset(buf, 0, sizeof(buf));
char *tmp = buf;
- ret = g_ceph_context->_conf->get_val("num_client", &tmp, sizeof(buf));
+ ret = g_ceph_context->_conf->get_val("log_graylog_port", &tmp, sizeof(buf));
ASSERT_EQ(ret, 0);
ASSERT_EQ(string("21"), string(buf));
}
ASSERT_EQ(string("/tmp/my-keyfile"), string(buf));
memset(buf, 0, sizeof(buf));
- ret = g_ceph_context->_conf->get_val("num_client", &tmp, sizeof(buf));
+ ret = g_ceph_context->_conf->get_val("log_graylog_port", &tmp, sizeof(buf));
ASSERT_EQ(ret, 0);
ASSERT_EQ(string("22"), string(buf));
ASSERT_EQ(string("42"), string(buf));
memset(buf, 0, sizeof(buf));
- ret = g_ceph_context->_conf->get_val("num_client", &tmp, sizeof(buf));
+ ret = g_ceph_context->_conf->get_val("log_graylog_port", &tmp, sizeof(buf));
ASSERT_EQ(ret, 0);
ASSERT_EQ(string("56"), string(buf));
injection = "--num-client 57";
ret = g_ceph_context->_conf->injectargs(injection, &cout);
ASSERT_EQ(ret, 0);
- ret = g_ceph_context->_conf->get_val("num_client", &tmp, sizeof(buf));
+ ret = g_ceph_context->_conf->get_val("log_graylog_port", &tmp, sizeof(buf));
ASSERT_EQ(ret, 0);
ASSERT_EQ(string("57"), string(buf));
}
// But, debug should still be set...
memset(buf, 0, sizeof(buf));
- ret = g_ceph_context->_conf->get_val("num_client", &tmp, sizeof(buf));
+ ret = g_ceph_context->_conf->get_val("log_graylog_port", &tmp, sizeof(buf));
ASSERT_EQ(ret, 0);
ASSERT_EQ(string("28"), string(buf));
{
long long bad_value = (long long)std::numeric_limits<int>::max() + 1;
string str = boost::lexical_cast<string>(bad_value);
- int ret = g_ceph_context->_conf->set_val("num_client", str);
+ int ret = g_ceph_context->_conf->set_val("log_graylog_port", str);
ASSERT_EQ(ret, -EINVAL);
}
{
// 4G must be greater than INT_MAX
ASSERT_GT(4LL * 1024 * 1024 * 1024, (long long)std::numeric_limits<int>::max());
- int ret = g_ceph_context->_conf->set_val("num_client", "4G");
+ int ret = g_ceph_context->_conf->set_val("log_graylog_port", "4G");
ASSERT_EQ(ret, -EINVAL);
}
}