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:
parent
cdfdde3334
commit
3500ec86dc
1 changed files with 20 additions and 20 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue