提交 dcaa85d9 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Improve PlainRtpTransport and PipeTransport stats

上级 736f2e42
...@@ -131,9 +131,20 @@ namespace RTC ...@@ -131,9 +131,20 @@ namespace RTC
else else
{ {
// Add bytesReceived. // Add bytesReceived.
jsonObject["bytesReceived"] = 0; jsonObject["bytesReceived"] = this->udpSocket->GetRecvBytes();
// Add bytesSent. // Add bytesSent.
jsonObject["bytesSent"] = 0; jsonObject["bytesSent"] = this->udpSocket->GetSentBytes();
// Add tuple.
jsonObject["tuple"] = json::object();
auto jsonTupleIt = jsonObject.find("tuple");
if (this->listenIp.announcedIp.empty())
(*jsonTupleIt)["localIp"] = this->udpSocket->GetLocalIp();
else
(*jsonTupleIt)["localIp"] = this->listenIp.announcedIp;
(*jsonTupleIt)["localPort"] = this->udpSocket->GetLocalPort();
(*jsonTupleIt)["protocol"] = "udp";
} }
} }
......
...@@ -217,6 +217,15 @@ namespace RTC ...@@ -217,6 +217,15 @@ namespace RTC
// Add timestamp. // Add timestamp.
jsonObject["timestamp"] = DepLibUV::GetTime(); jsonObject["timestamp"] = DepLibUV::GetTime();
// Add rtcpMux.
jsonObject["rtcpMux"] = this->rtcpMux;
// Add comedia.
jsonObject["comedia"] = this->comedia;
// Add multiSource.
jsonObject["multiSource"] = this->multiSource;
if (this->tuple != nullptr) if (this->tuple != nullptr)
{ {
// Add bytesReceived. // Add bytesReceived.
...@@ -228,10 +237,31 @@ namespace RTC ...@@ -228,10 +237,31 @@ namespace RTC
} }
else else
{ {
size_t bytesReceived = this->udpSocket->GetRecvBytes();
size_t bytesSent = this->udpSocket->GetSentBytes();
;
if (this->rtcpUdpSocket)
{
bytesReceived += this->rtcpUdpSocket->GetRecvBytes();
bytesSent += this->rtcpUdpSocket->GetSentBytes();
}
// Add bytesReceived. // Add bytesReceived.
jsonObject["bytesReceived"] = 0; jsonObject["bytesReceived"] = bytesReceived;
// Add bytesSent. // Add bytesSent.
jsonObject["bytesSent"] = 0; jsonObject["bytesSent"] = bytesSent;
// Add tuple.
jsonObject["tuple"] = json::object();
auto jsonTupleIt = jsonObject.find("tuple");
if (this->listenIp.announcedIp.empty())
(*jsonTupleIt)["localIp"] = this->udpSocket->GetLocalIp();
else
(*jsonTupleIt)["localIp"] = this->listenIp.announcedIp;
(*jsonTupleIt)["localPort"] = this->udpSocket->GetLocalPort();
(*jsonTupleIt)["protocol"] = "udp";
} }
// Add rtcpTuple. // Add rtcpTuple.
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论