mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd::db: Additional parallel seek log metric; assertion tool.
This commit is contained in:
parent
c2562d7dfa
commit
5593ae3a60
1 changed files with 20 additions and 2 deletions
22
ircd/db.cc
22
ircd/db.cc
|
@ -8010,6 +8010,8 @@ ircd::db::_read(column &column,
|
|||
if(likely(closure))
|
||||
closure(value);
|
||||
|
||||
// triggered when the result was not zero-copy
|
||||
//assert(buf.empty());
|
||||
return size(value);
|
||||
}
|
||||
|
||||
|
@ -8043,6 +8045,8 @@ ircd::db::_read(std::nothrow_t,
|
|||
if(likely(closure))
|
||||
closure(value);
|
||||
|
||||
// triggered when the result was not zero-copy
|
||||
//assert(buf.empty());
|
||||
return size(value);
|
||||
}
|
||||
|
||||
|
@ -8104,9 +8108,17 @@ ircd::db::_read(const vector_view<_read_op> &op,
|
|||
op.size()
|
||||
};
|
||||
|
||||
rocksdb::Status status[num];
|
||||
std::string buf[num];
|
||||
rocksdb::PinnableSlice val[num];
|
||||
for(size_t i(0); i < num; ++i)
|
||||
new (val + i) rocksdb::PinnableSlice
|
||||
{
|
||||
buf + i
|
||||
};
|
||||
|
||||
rocksdb::Status status[num];
|
||||
_seek(op, {status, num}, {val, num}, ropts);
|
||||
|
||||
if(closure) for(size_t i(0); i < op.size(); ++i)
|
||||
{
|
||||
const column::delta &delta
|
||||
|
@ -8118,6 +8130,9 @@ ircd::db::_read(const vector_view<_read_op> &op,
|
|||
return false;
|
||||
}
|
||||
|
||||
// triggered when the result was not zero-copy
|
||||
//assert(!std::count_if(buf, buf + num, [](auto &&s) { return !s.empty(); }));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -8165,11 +8180,14 @@ ircd::db::_seek(const vector_view<_read_op> &op,
|
|||
#ifdef RB_DEBUG_DB_SEEK
|
||||
log::debug
|
||||
{
|
||||
log, "[%s] %lu:%lu SEEK parallel:%zu in %ld$us",
|
||||
log, "[%s] %lu:%lu SEEK parallel:%zu ok:%zu nf:%zu inc:%zu in %ld$us",
|
||||
name(d),
|
||||
sequence(d),
|
||||
sequence(ropts.snapshot),
|
||||
ret.size(),
|
||||
std::count_if(begin(ret), end(ret), [](auto&& s) { return s.ok(); }),
|
||||
std::count_if(begin(ret), end(ret), [](auto&& s) { return s.IsNotFound(); }),
|
||||
std::count_if(begin(ret), end(ret), [](auto&& s) { return s.IsIncomplete(); }),
|
||||
timer.at<microseconds>().count(),
|
||||
};
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue