0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-08 21:18:57 +02:00

ircd:Ⓜ️:acquire: Add accumulators for acquires and fetches.

This commit is contained in:
Jason Volk 2022-07-08 22:50:37 -07:00
parent f9f5d75ccd
commit 9788ce9863
3 changed files with 9 additions and 5 deletions

View file

@ -23,12 +23,15 @@ struct ircd::m::acquire
struct result;
static log::log log;
static uint64_t ids;
const uint64_t id {++ids};
const struct opts &opts;
vm::opts head_vmopts;
vm::opts history_vmopts;
vm::opts state_vmopts;
std::list<result> fetching;
uint64_t fetches {0};
private:
bool full() const noexcept;

View file

@ -14,6 +14,9 @@ ircd::m::acquire::log
"m.acquire"
};
decltype(ircd::m::acquire::ids)
ircd::m::acquire::ids;
template<>
decltype(ircd::util::instance_list<ircd::m::acquire>::allocator)
ircd::util::instance_list<ircd::m::acquire>::allocator
@ -635,6 +638,7 @@ try
.backfill_limit = limit,
}));
fetches++;
return true;
}
catch(const ctx::interrupted &e)

View file

@ -11269,15 +11269,14 @@ console_cmd__room__acquire__list(opt &out, const string_view &line)
<< " "
<< std::endl;
size_t i(0);
for(const auto *const &a : m::acquire::list)
{
size_t j(0);
for(const auto &result : a->fetching)
out
<< std::right << std::setw(4) << i
<< std::right << std::setw(4) << a->id
<< " "
<< std::right << std::setw(4) << j++
<< std::right << std::setw(4) << (a->fetches - j++)
<< " "
<< std::left << std::setw(50) << trunc(a->opts.room.room_id, 40)
<< " "
@ -11294,8 +11293,6 @@ console_cmd__room__acquire__list(opt &out, const string_view &line)
<< std::left << std::setw(50) << trunc(result.event_id, 60)
<< " "
<< std::endl;
i++;
}
return true;