mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 08:23:56 +01:00
ircd::db: Deinline stats ctor; zero-init histogram; implement Reset().
This commit is contained in:
parent
a806ce2762
commit
e5a96aab93
2 changed files with 17 additions and 4 deletions
|
@ -21,7 +21,7 @@ struct ircd::db::database::stats final
|
|||
{
|
||||
database *d;
|
||||
std::array<uint64_t, rocksdb::TICKER_ENUM_MAX> ticker {{0}};
|
||||
std::array<rocksdb::HistogramData, rocksdb::HISTOGRAM_ENUM_MAX> histogram;
|
||||
std::array<rocksdb::HistogramData, rocksdb::HISTOGRAM_ENUM_MAX> histogram {{0.0}};
|
||||
|
||||
uint64_t getTickerCount(const uint32_t tickerType) const noexcept override;
|
||||
void recordTick(const uint32_t tickerType, const uint64_t count) noexcept override;
|
||||
|
@ -30,8 +30,7 @@ struct ircd::db::database::stats final
|
|||
void measureTime(const uint32_t histogramType, const uint64_t time) noexcept override;
|
||||
bool HistEnabledForType(const uint32_t type) const noexcept override;
|
||||
uint64_t getAndResetTickerCount(const uint32_t tickerType) noexcept override;
|
||||
rocksdb::Status Reset() noexcept override;
|
||||
|
||||
stats(database *const &d)
|
||||
:d{d}
|
||||
{}
|
||||
stats(database *const &d);
|
||||
};
|
||||
|
|
14
ircd/db.cc
14
ircd/db.cc
|
@ -1884,6 +1884,20 @@ ircd::db::histogram_max
|
|||
// database::stats (db/database/stats.h) internal
|
||||
//
|
||||
|
||||
ircd::db::database::stats::stats(database *const &d)
|
||||
:d{d}
|
||||
{
|
||||
}
|
||||
|
||||
rocksdb::Status
|
||||
ircd::db::database::stats::Reset()
|
||||
noexcept
|
||||
{
|
||||
ticker.fill(0);
|
||||
histogram.fill({0.0});
|
||||
return rocksdb::Status::OK();
|
||||
}
|
||||
|
||||
uint64_t
|
||||
ircd::db::database::stats::getAndResetTickerCount(const uint32_t type)
|
||||
noexcept
|
||||
|
|
Loading…
Reference in a new issue