0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-27 19:28:52 +02:00

ircd::db: Update pure-virtual requirement in database::stats.

This commit is contained in:
Jason Volk 2017-07-18 11:11:00 -06:00
parent 7df3f6b5e6
commit 4f095024ee

View file

@ -129,6 +129,7 @@ struct database::stats
void histogramData(const uint32_t type, rocksdb::HistogramData *) const override; void histogramData(const uint32_t type, rocksdb::HistogramData *) const override;
void measureTime(const uint32_t histogramType, const uint64_t time) override; void measureTime(const uint32_t histogramType, const uint64_t time) override;
bool HistEnabledForType(const uint32_t type) const override; bool HistEnabledForType(const uint32_t type) const override;
uint64_t getAndResetTickerCount(const uint32_t tickerType) override;
stats(database *const &d) stats(database *const &d)
:d{d} :d{d}
@ -848,6 +849,14 @@ ircd::db::log_rdb_perf_context(const bool &all)
log.debug("%s", rocksdb::perf_context.ToString(exclude_zeros)); log.debug("%s", rocksdb::perf_context.ToString(exclude_zeros));
} }
uint64_t
ircd::db::database::stats::getAndResetTickerCount(const uint32_t type)
{
const auto ret(getTickerCount(type));
setTickerCount(type, 0);
return ret;
}
bool bool
ircd::db::database::stats::HistEnabledForType(const uint32_t type) ircd::db::database::stats::HistEnabledForType(const uint32_t type)
const const
@ -1653,14 +1662,15 @@ ircd::db::has(column &column,
return false; return false;
// Perform a query to the cache // Perform a query to the cache
auto status(d.d->Get(opts, c, k, nullptr)); static std::string *const null_str_ptr(nullptr);
auto status(d.d->Get(opts, c, k, null_str_ptr));
if(status.IsIncomplete()) if(status.IsIncomplete())
{ {
// DB cache miss; next query requires I/O, offload it // DB cache miss; next query requires I/O, offload it
opts.read_tier = BLOCKING; opts.read_tier = BLOCKING;
ctx::offload([&d, &c, &k, &opts, &status] ctx::offload([&d, &c, &k, &opts, &status]
{ {
status = d.d->Get(opts, c, k, nullptr); status = d.d->Get(opts, c, k, null_str_ptr);
}); });
} }