xo-alloc: track GC efficiency
This commit is contained in:
parent
d751093a87
commit
0a19c8b043
2 changed files with 28 additions and 0 deletions
|
|
@ -103,6 +103,23 @@ namespace xo {
|
|||
<< ">";
|
||||
}
|
||||
|
||||
float
|
||||
GcStatisticsHistoryItem::collection_rate() const {
|
||||
using namespace xo::qty::qty;
|
||||
|
||||
float gz = this->garbage_z();
|
||||
|
||||
auto dt_nanos = this->dt_.with_repr<float>();
|
||||
auto dt_sec = dt_nanos.rescale_ext<xo::qty::u::second>();
|
||||
auto rate = gz / dt_sec;
|
||||
float retval = rate.scale();
|
||||
|
||||
//scope log(XO_DEBUG(true));
|
||||
//log && log(xtag("gz", gz), xtag("dt_sec", dt_sec), xtag("rate", rate), xtag("rate/sec", retval));
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
void
|
||||
GcStatisticsHistoryItem::display(std::ostream & os) const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue