[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-server-cvs
Subject:    [Server-cvs] protocol/rtsp rtspserv.cpp,1.266,1.267
From:       srao () helixcommunity ! org
Date:       2007-05-30 7:31:25
Message-ID: 200705300731.l4U7VYPq030841 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/server/protocol/rtsp
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv14877

Modified Files:
	rtspserv.cpp 
Log Message:
Synopsis
========
Fixes PR 186911: Siemens-Post:rsSessionEntry values not accurate (This is propagation of PR143602)

Branches: HEAD
Suggested Reviewer: Darrick


Description
===========
The stat variables SendingTime, FailedResends, SuccessfulResends are always reporting zero because
stat object is getting updated only once when the client is disconnecting. 


Fix:
===============
implemented a new inline method UpdateSucessFailureResendCount() in class RTSPServerProtocol to
update these stats variables, This new method get called only when uNakListCount > 0 from
RTSPServerProtocol::::OnACK() and is responsible for updating SuccessfulResends and FailedResends of
QoSInfo. 


SendingTime is simply the difference between clip start time and current time. 
So I am populating starting time in SessionStats::SetSessionStartTime() and calculating elapsed time
in function SessionStats::GetSendingTime() which get called by SNMP to retrieve SendingTime. 


Files Affected
==============
/server/engine/context/server_stats.cpp
/server/engine/context/pub/server_stats.h
/server/protocol/rtsp/rtspserv.cpp
/server/protocol/rtsp/pub/rtspserv.h

Testing Performed
=================
1)
enabled templatized logging with template
"Failed :%Client.*.Session.*.FailedResends%\t Sucess:
%Client.*.Session.*.SuccessfulResends%\tSendingTime:%Client.*.Session.*.SendingTime%\n"

and observed that custom log is getting updated with proper values for the specified interval. 

2) enabled SNMP and observed that SendingTime parameter is getting updated correctly.

Build verified: win32-i386-vc6


QA Hints
===============
1. Configure SNMP and start monitoring the required parameters. 

Note: This fix is to provide correct values of SuccessfulResends , FailureResends and SendingTime to
SNMP. SNMP reads these values from the STATS object. This fix only updates stats to provide correct
values to SNMP. Registry functionality would not be modified with this fix. It gets updated only
when session disconnects as designed earlier.



Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.266
retrieving revision 1.267
diff -u -d -r1.266 -r1.267
--- rtspserv.cpp	21 May 2007 10:00:29 -0000	1.266
+++ rtspserv.cpp	30 May 2007 07:31:23 -0000	1.267
@@ -66,6 +66,7 @@
 #include "bdst_stats.h"
 #include "bcngtran.h"
 #include "defslice.h"
+#include "hxqosinfo.h"
 
 #ifdef _WINCE
 #include <wincestr.h>
@@ -4382,13 +4383,74 @@
 
     Transport* pTrans = pSession->getTransport(uStreamNumber);
 
-    return handleACK(pSession->m_pPacketResend, pResendBuffer,
+    HX_RESULT retVal = HXR_OK;
+    retVal = handleACK(pSession->m_pPacketResend, pResendBuffer,
                      uStreamNumber,
                      pAckList, uAckListCount,
                      pNakList, uNakListCount,
                      pTrans ? pTrans->isBCM() : FALSE);
+
+    //update statics if uNakListCount > 0
+    if (uNakListCount && retVal == HXR_OK && m_pResp)                    
+    {
+        UpdateSuccessFailureResendCount(pTrans, pSession);
+    }
+    
+    return retVal;
 };
 
+inline void
+RTSPServerProtocol::UpdateSuccessFailureResendCount(Transport* pTrans, 
+                                    RTSPServerSession* pSession)
+{
+    TransportStreamHandler*  pStreamHandler = NULL;
+    pStreamHandler = pTrans->GetStreamHandler();
+    
+    RTSPStreamData* pStreamData = pStreamHandler->firstStreamData();
+
+    UINT32 ulTotalSuccessfulResends = 0;
+    UINT32 ulTotalFailedResends = 0;
+        
+    while (pStreamData)
+    {
+        UINT32 ulResendSuccess = 0;
+        UINT32 ulResendFailure = 0;
+            
+        if (pStreamData->m_pResendBuffer)
+        {
+            pStreamData->m_pResendBuffer->UpdateStatistics(ulResendSuccess,
+                                                       ulResendFailure);
+        }
+
+        ulTotalSuccessfulResends += ulResendSuccess;
+        ulTotalFailedResends += ulResendFailure;
+
+        pStreamData = pStreamHandler->nextStreamData();
+    }
+
+    HX_RELEASE(pStreamHandler);
+
+    IHXClientStats* pClientStats = m_pClientStatsMgr->GetClient(m_ulClientStatsObjId);
+    if (pClientStats)
+    {
+        IHXSessionStats* pSessionStats = pClientStats->GetSession(pSession->m_ulSessionStatsObjId);
+
+        if (pSessionStats)
+        {
+            IHXQoSTransportAdaptationInfo* pQoSInfo = pSessionStats->GetQoSTransportAdaptationInfo();
+            if (pQoSInfo)
+            {
+                pQoSInfo->SetSuccessfulResends(ulTotalSuccessfulResends);
+                pQoSInfo->SetFailedResends(ulTotalFailedResends);
+                HX_RELEASE(pQoSInfo);   
+            }
+            HX_RELEASE(pSessionStats);
+        }
+        
+        HX_RELEASE(pClientStats);   
+    }
+}
+
 STDMETHODIMP
 RTSPServerProtocol::OnProtocolError(HX_RESULT status)
 {


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic