]>
git.proxmox.com Git - ceph.git/blob - ceph/src/test/neorados/start_stop.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2019 Red Hat <contact@redhat.com>
7 * Author: Adam C. Emerson <aemerson@redhat.com>
9 * This is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License version 2.1, as published by the Free Software
12 * Foundation. See file COPYING.
19 #include "include/neorados/RADOS.hpp"
21 #include "common/async/context_pool.h"
22 #include "common/ceph_argparse.h"
24 #include "global/global_init.h"
26 namespace R
= neorados
;
29 int main(int argc
, char** argv
)
31 using namespace std::literals
;
33 auto args
= argv_to_vec(argc
, argv
);
36 auto cct
= global_init(nullptr, args
, CEPH_ENTITY_TYPE_CLIENT
,
37 CODE_ENVIRONMENT_UTILITY
, 0);
38 common_init_finish(cct
.get());
41 ceph::async::io_context_pool
p(1);
42 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
43 boost::asio::use_future
).get();
44 std::this_thread::sleep_for(30s
);
46 std::this_thread::sleep_for(30s
);
48 ceph::async::io_context_pool
p(1);
49 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
50 boost::asio::use_future
).get();
51 std::this_thread::sleep_for(30s
);
54 ceph::async::io_context_pool
p(1);
55 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
56 boost::asio::use_future
).get();
57 std::this_thread::sleep_for(1s
);
60 ceph::async::io_context_pool
p(1);
61 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
62 boost::asio::use_future
).get();
63 std::this_thread::sleep_for(1s
);
66 ceph::async::io_context_pool
p(1);
67 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
68 boost::asio::use_future
).get();
69 std::this_thread::sleep_for(1s
);
72 ceph::async::io_context_pool
p(1);
73 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
74 boost::asio::use_future
).get();
75 std::this_thread::sleep_for(1s
);
78 ceph::async::io_context_pool
p(1);
79 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
80 boost::asio::use_future
).get();
81 std::this_thread::sleep_for(1s
);
84 ceph::async::io_context_pool
p(1);
85 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
86 boost::asio::use_future
).get();
87 std::this_thread::sleep_for(1s
);
90 ceph::async::io_context_pool
p(1);
91 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
92 boost::asio::use_future
).get();
93 std::this_thread::sleep_for(1s
);
96 ceph::async::io_context_pool
p(1);
97 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
98 boost::asio::use_future
).get();
99 std::this_thread::sleep_for(500ms
);
102 ceph::async::io_context_pool
p(1);
103 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
104 boost::asio::use_future
).get();
105 std::this_thread::sleep_for(500ms
);
108 ceph::async::io_context_pool
p(1);
109 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
110 boost::asio::use_future
).get();
111 std::this_thread::sleep_for(50ms
);
114 ceph::async::io_context_pool
p(1);
115 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
116 boost::asio::use_future
).get();
117 std::this_thread::sleep_for(50ms
);
120 ceph::async::io_context_pool
p(1);
121 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
122 boost::asio::use_future
).get();
123 std::this_thread::sleep_for(50ms
);
126 ceph::async::io_context_pool
p(1);
127 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
128 boost::asio::use_future
).get();
129 std::this_thread::sleep_for(5ms
);
132 ceph::async::io_context_pool
p(1);
133 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
134 boost::asio::use_future
).get();
135 std::this_thread::sleep_for(5ms
);
138 ceph::async::io_context_pool
p(1);
139 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
140 boost::asio::use_future
).get();
141 std::this_thread::sleep_for(5ms
);
144 ceph::async::io_context_pool
p(1);
145 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
146 boost::asio::use_future
).get();
147 std::this_thread::sleep_for(5ms
);
150 ceph::async::io_context_pool
p(1);
151 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
152 boost::asio::use_future
).get();
153 std::this_thread::sleep_for(5ms
);
156 ceph::async::io_context_pool
p(1);
157 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
158 boost::asio::use_future
).get();
159 std::this_thread::sleep_for(5us
);
162 ceph::async::io_context_pool
p(1);
163 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
164 boost::asio::use_future
).get();
165 std::this_thread::sleep_for(5us
);
168 ceph::async::io_context_pool
p(1);
169 auto r
= R::RADOS::make_with_cct(cct
.get(), p
,
170 boost::asio::use_future
).get();
171 std::this_thread::sleep_for(5us
);