Extend report()

ReportInfo to allow pass through from Source.
Also include peer credentials
This commit is contained in:
Michael Davidsaver
2021-06-29 19:45:31 -07:00
parent 99c1534dfa
commit 3145c010d2
8 changed files with 80 additions and 9 deletions
+10 -2
View File
@@ -402,11 +402,11 @@ void Context::ignoreServerGUIDs(const std::vector<ServerGUID>& guids)
});
}
Report Context::report() const
Report Context::report(bool zero) const
{
Report ret;
pvt->impl->tcp_loop.call([this, &ret](){
pvt->impl->tcp_loop.call([this, &ret, zero](){
for(auto& pair : pvt->impl->connByAddr) {
auto conn = pair.second.lock();
@@ -419,6 +419,10 @@ Report Context::report() const
sconn.tx = conn->statTx;
sconn.rx = conn->statRx;
if(zero) {
conn->statTx = conn->statRx = 0u;
}
// omit stats for transitory conn->creatingByCID
for(auto& pair : conn->chanBySID) {
@@ -431,6 +435,10 @@ Report Context::report() const
schan.name = chan->name;
schan.tx = chan->statTx;
schan.rx = chan->statRx;
if(zero) {
chan->statTx = chan->statRx = 0u;
}
}
}