0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd:Ⓜ️:events: Improve dump loop and infolog.

This commit is contained in:
Jason Volk 2020-01-08 14:38:26 -08:00
parent cdfdde3334
commit 3500ec86dc

View file

@ -113,31 +113,31 @@ ircd::m::events::dump__file(const string_view &filename)
const mutable_buffer mb{pos, remain};
pos += copy(mb, event.source);
++ecount;
if(pos + event::MAX_SIZE > data(buf) + size(buf))
{
const const_buffer cb{data(buf), pos};
const const_buffer cb
{
data(buf), pos
};
foff += size(fs::append(file, cb));
pos = data(buf);
++acount;
const double pct
if(acount++ % 256 == 0)
{
(seq / double(m::vm::sequence::retired)) * 100.0
};
log::info
{
"dump[%s] %0.2lf%% @ seq %zu of %zu; %zu events; %zu bytes; %zu writes; %zu errors",
filename,
pct,
seq,
m::vm::sequence::retired,
ecount,
foff,
acount,
errcount
};
char pbuf[48];
log::info
{
"dump[%s] %0.2lf%% @ seq %zu of %zu; %zu events; %s in %zu writes; %zu errors",
filename,
(seq / double(m::vm::sequence::retired)) * 100.0,
seq,
m::vm::sequence::retired,
ecount,
pretty(pbuf, iec(foff)),
acount,
errcount
};
}
}
return true;