Uncrustify maxscale
See script directory for method. The script to run in the top level MaxScale directory is called maxscale-uncrustify.sh, which uses another script, list-src, from the same directory (so you need to set your PATH). The uncrustify version was 0.66.
This commit is contained in:
@ -14,34 +14,32 @@ int main(int argc, char** argv)
|
||||
{
|
||||
TestConnections test(argc, argv);
|
||||
std::vector<std::thread> threads;
|
||||
std::atomic<bool> running{true};
|
||||
std::atomic<int> conns{0};
|
||||
std::atomic<bool> running {true};
|
||||
std::atomic<int> conns {0};
|
||||
|
||||
auto start = std::chrono::steady_clock::now();
|
||||
|
||||
// Create some threads so that we have a constant load on the system
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
threads.emplace_back([&, i]()
|
||||
{
|
||||
while (running)
|
||||
{
|
||||
Connection c = i % 2 == 0 ? test.maxscales->rwsplit() : test.maxscales->readconn_master();
|
||||
if (c.connect())
|
||||
{
|
||||
c.query("CREATE TABLE IF NOT EXITS test.t1 (id INT)");
|
||||
c.query("INSERT INTO test.t1 VALUES (" + std::to_string(i) + ")");
|
||||
c.query("SELECT * FROM test.t1");
|
||||
c.query("DELETE FROM test.t1 WHERE id = " + std::to_string(i));
|
||||
++conns;
|
||||
}
|
||||
else
|
||||
{
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
threads.emplace_back([&, i]() {
|
||||
while (running)
|
||||
{
|
||||
Connection c = i % 2 == 0 ? test.maxscales->rwsplit() : test.maxscales->readconn_master();
|
||||
if (c.connect())
|
||||
{
|
||||
c.query("CREATE TABLE IF NOT EXITS test.t1 (id INT)");
|
||||
c.query("INSERT INTO test.t1 VALUES (" + std::to_string(i) + ")");
|
||||
c.query("SELECT * FROM test.t1");
|
||||
c.query("DELETE FROM test.t1 WHERE id = " + std::to_string(i));
|
||||
++conns;
|
||||
}
|
||||
else
|
||||
{
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Allows the use of operator+ for concatenation
|
||||
@ -55,10 +53,16 @@ int main(int argc, char** argv)
|
||||
create + "server server3 " + test.repl->IP[2] + " 3306",
|
||||
create + "server server4 " + test.repl->IP[3] + " 3306",
|
||||
// A monitor for the servers
|
||||
create + "monitor monitor1 mysqlmon monitor_interval=1000 user=skysql password=skysql --servers server1 server2 server3 server4",
|
||||
create
|
||||
+
|
||||
"monitor monitor1 mysqlmon monitor_interval=1000 user=skysql password=skysql --servers server1 server2 server3 server4",
|
||||
// Services, one readwritesplit and one readconnroute
|
||||
create + "service service1 readwritesplit user=skysql password=skysql --servers server1 server2 server3 server4",
|
||||
create + "service service2 readconnroute user=skysql password=skysql router_options=master --servers server1 server2 server3 server4",
|
||||
create
|
||||
+
|
||||
"service service1 readwritesplit user=skysql password=skysql --servers server1 server2 server3 server4",
|
||||
create
|
||||
+
|
||||
"service service2 readconnroute user=skysql password=skysql router_options=master --servers server1 server2 server3 server4",
|
||||
// Create listeners for the services
|
||||
create + "listener service1 listener1 4006",
|
||||
create + "listener service2 listener2 4008",
|
||||
@ -116,7 +120,8 @@ int main(int argc, char** argv)
|
||||
|
||||
auto end = std::chrono::steady_clock::now();
|
||||
|
||||
test.tprintf("A total of %d connections were created over %d seconds", conns.load(),
|
||||
test.tprintf("A total of %d connections were created over %d seconds",
|
||||
conns.load(),
|
||||
std::chrono::duration_cast<std::chrono::seconds>(end - start).count());
|
||||
|
||||
return test.global_result;
|
||||
|
||||
Reference in New Issue
Block a user