Transcoder stats reported on CCodecStream DTOR

unstable
Tom Early 4 years ago
parent 28bfa671a1
commit 6f528df70c

@ -136,6 +136,11 @@ WriteSRCHFile ()
if [[ "$m" != true ]]; then
echo "#define NO_G3" >> $file
fi
if [ -n ${dbsupport+x} ]; then
if [ "$dbsupport" == true ]; then
echo "#define DEBUG" >> $file
fi
fi
}
WriteSRCMKFile ()
@ -176,7 +181,11 @@ WriteTranscoderHFile ()
if [ -n ${tcaddress+x} ] && [[ "$tcaddress" != "local" ]]; then
echo "#define TRANSCODER_IP \"${tcaddress}\"" >> $file
fi
if [ -n ${dbsupport+x} ]; then
if [ "$dbsupport" == true ]; then
echo "#define DEBUG" >> $file
fi
fi
}
WriteTranscoderMKFile ()
@ -326,7 +335,7 @@ while [[ "$key" != q* ]]
do
clear
echo
echo " Reflector Configuration, Version #211205"
echo " Reflector Configuration, Version #211207"
echo
echo " ******* REFLECTOR ********"
echo -n "cs : Reflector Callsign = "; EvaluateVar callsign{,_d}

@ -55,6 +55,22 @@ CCodecStream::~CCodecStream()
{
m_Future.get();
}
// display stats
if (m_fPingMin >= 0.0)
{
double min = m_fPingMin * 1000.0;
double max = m_fPingMax * 1000.0;
double ave = (m_fPingCount > 0) ? m_fPingSum / m_fPingCount * 1000.0 : 0.0;
auto prec = std::cout.precision();
std::cout.precision(1);
std::cout << "Transcoder Stats (ms): " << min << "/" << ave << "/" << max << std::endl;
std::cout.precision(prec);
}
if (m_uiTimeoutPackets)
{
std::cout << m_uiTimeoutPackets << " of " << m_uiTotalPackets << " packets timed out" << std::endl;
}
}
////////////////////////////////////////////////////////////////////////////////////////
@ -86,21 +102,6 @@ void CCodecStream::Thread()
{
Task();
}
// display stats
if (m_fPingMin >= 0.0)
{
double min = m_fPingMin * 1000.0;
double max = m_fPingMax * 1000.0;
double ave = (m_fPingCount > 0) ? m_fPingSum / m_fPingCount * 1000.0 : 0.0;
auto prec = std::cout.precision();
std::cout.precision(1);
std::cout << "Transcoder Stats (ms): " << min << "/" << ave << "/" << max << std::endl;
std::cout.precision(prec);
}
if (m_uiTimeoutPackets)
{
std::cout << m_uiTimeoutPackets << " of " << m_uiTotalPackets << " packets timed out" << std::endl;
}
}
void CCodecStream::Task(void)

@ -183,7 +183,6 @@ void CM17Protocol::OnDvHeaderPacketIn(std::unique_ptr<CDvHeaderPacket> &Header,
CCallsign my(Header->GetMyCallsign());
CCallsign rpt1(Header->GetRpt1Callsign());
CCallsign rpt2(Header->GetRpt2Callsign());
std::cout << "New Header: my=" << my << " Rpt1=" << rpt1 << " Rpt2=" << rpt2 << std::endl;
// find this client
std::shared_ptr<CClient>client = g_Reflector.GetClients()->FindClient(Ip, EProtocol::m17);
@ -192,7 +191,6 @@ void CM17Protocol::OnDvHeaderPacketIn(std::unique_ptr<CDvHeaderPacket> &Header,
// get client callsign
rpt1 = client->GetCallsign();
// and try to open the stream
std::cout << "Client has c/s=" << rpt1 << std::endl;
if ( (stream = g_Reflector.OpenStream(Header, client)) != nullptr )
{
// keep the handle

Loading…
Cancel
Save

Powered by TurnKey Linux.