Transaction&, laddr_t, extent_len_t) = 0;
virtual tm_future<NodeExtentRef> alloc_extent(Transaction&, extent_len_t) = 0;
virtual tm_future<Super::URef> get_super(Transaction&, RootNodeTracker&) = 0;
+ virtual std::ostream& print(std::ostream& os) const = 0;
static NodeExtentManagerURef create_dummy(bool is_sync);
static NodeExtentManagerURef create_seastore(
TransactionManager& tm, laddr_t min_laddr = L_ADDR_MIN);
};
+inline std::ostream& operator<<(std::ostream& os, const NodeExtentManager& nm) {
+ return nm.print(os);
+}
}
}
}
+ std::ostream& print(std::ostream& os) const override {
+ return os << "DummyNodeExtentManager(sync=" << SYNC << ")";
+ }
+
private:
tm_future<NodeExtentRef> read_extent_sync(
Transaction& t, laddr_t addr, extent_len_t len) {
return Super::URef(new SeastoreSuper(t, tracker, root_addr, tm));
});
}
+
+ std::ostream& print(std::ostream& os) const override {
+ return os << "SeastoreNodeExtentManager";
+ }
+
private:
static seastar::logger& logger() {
return crimson::get_logger(ceph_subsys_filestore);
return os;
}
+std::ostream& Btree::print(std::ostream& os) const {
+ return os << "BTree-" << *nm;
+}
+
btree_future<Ref<Node>> Btree::get_root(Transaction& t) {
auto root = root_tracker->get_root(t);
if (root) {
btree_future<size_t> height(Transaction&);
btree_future<tree_stats_t> get_stats_slow(Transaction&);
std::ostream& dump(Transaction&, std::ostream&);
+ std::ostream& print(std::ostream& os) const;
// test_only
bool test_is_clean() const;
friend class DummyChildPool;
};
+inline std::ostream& operator<<(std::ostream& os, const Btree& tree) {
+ return tree.print(os);
+}
class tree_cursor_t;
class Btree::Cursor {
: kvs{kvs}, tree{std::move(nm)} {}
future<> bootstrap(Transaction& t) {
- return tree.mkfs(t);
- }
-
- future<> insert(Transaction& t) {
std::ostringstream oss;
#ifndef NDEBUG
- oss << "debug on, ";
+ oss << "debug=on, ";
+#else
+ oss << "debug=off, ";
+#endif
+#ifdef UNIT_TESTS_BUILT
+ oss << "UNIT_TEST_BUILT=on, ";
#else
- oss << "debug off, ";
+ oss << "UNIT_TEST_BUILT=off, ";
#endif
if constexpr (TRACK) {
- oss << "track on";
+ oss << "track=on, ";
} else {
- oss << "track off";
+ oss << "track=off, ";
}
+ oss << tree;
+ logger().warn("TreeBuilder: {}, bootstrapping ...", oss.str());
+ return tree.mkfs(t);
+ }
+
+ future<> insert(Transaction& t) {
kv_iter = kvs.random_begin();
auto cursors = seastar::make_lw_shared<std::vector<Btree::Cursor>>();
- logger().warn("start inserting {} kvs ({}) ...", kvs.size(), oss.str());
+ logger().warn("start inserting {} kvs ...", kvs.size());
auto start_time = mono_clock::now();
return crimson::do_until([&t, this, cursors]() -> future<bool> {
if (kv_iter.is_end()) {
#include <seastar/core/app-template.hh>
#include <seastar/core/thread.hh>
+#include "crimson/common/log.h"
#include "crimson/os/seastore/onode_manager/staged-fltree/tree_utils.h"
#include "crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager.h"
#include "test/crimson/seastore/transaction_manager_test_state.h"
using namespace crimson::os::seastore::onode;
namespace bpo = boost::program_options;
+seastar::logger& logger() {
+ return crimson::get_logger(ceph_subsys_test);
+}
+
template <bool TRACK>
class PerfTree : public TMTestState {
public:
{
auto t = tm->create_transaction();
tree->insert(*t).unsafe_get();
+ auto start_time = mono_clock::now();
tm->submit_transaction(std::move(t)).unsafe_get();
+ std::chrono::duration<double> duration = mono_clock::now() - start_time;
+ logger().warn("submit_transaction() done! {}s", duration.count());
}
{
auto t = tm->create_transaction();