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

List:       helix-server-cvs
Subject:    [Server-cvs] engine/context server_stats.cpp,1.37.6.16,1.37.6.17
From:       jgordon () helixcommunity ! org
Date:       2007-08-31 1:33:59
Message-ID: 200708310134.l7V1Y9hY030935 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/server/engine/context
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv30846/context

Modified Files:
      Tag: SERVER_BORABORA
	server_stats.cpp 
Log Message:
Synopsis
========
Fixes PR 201655 (clip PlayTime not updated after first clip) and
some other clip stats reporting problems

Branches: SERVER_BORABORA, HEAD (SERVER_CURRENT)
Reviewer: seansmith


Description
===========
This fixes a few issues that I was not really able to separate into
separate diffs

SwitchCount:
SwitchCount was beginning with 1 rather than 0 and not being
incremented for the last clip in a session. This is because it
is a Session level stat but is actually a clip stat, and the log
callback was occurring after the stat had been updated for the
next clip. Also it was only updated in Switch but not on End.


PlayTime:
PPM and BasicPacketflow were getting the first ClipStats object
from the session and storing it as a member, and then updating
that ClipStats PlayTime. This does not work since it will just
always be holding onto the first clip stats object rather than
updating the correct one. Packet flows are not aware of switch
state and should only be in charge of session level stats.

The fix here is to simply update the clip's PlayTime based on
the overall session PlayTime whenever a clip ends.


Various:
Moved clip stats create/init and close/release to ClientSession
methods that can be called at start/end and switch, in order to
avoid duplicate code in both places and bugs with values being
set in only one.


Files Affected
==============
common/include/hxstats.h
server/log/tmplgpln/base_log.cpp
server/log/tmplgpln/legacy_access_log.h
server/engine/context/server_stats.cpp
server/engine/context/pub/server_stats.h
server/engine/dataflow/basicpcktflow.cpp
server/engine/dataflow/ppm.cpp
server/engine/dataflow/pub/basicpcktflow.h
server/engine/dataflow/pub/ppm.h
server/engine/session/clientsession.cpp
server/engine/session/pub/clientsession.h


Testing Performed
=================
Unit Tests:
None

Integration Tests:
Verified PlayTime, SwitchCount, FinalSwitch are all correct for:
* Normal non-switchable straming
* Switchable stream with no switches
* Normal Switch
* Delayed Switch
* Stream stopped by user
* Stream played out to end

Leak Tests:
None

Performance Tests:
None

Platforms Tested: linux-rhel4-i686
Build verified: linux-rhel4-i686, win32-i386-vc7, sunos-5.10-sparc-server


QA Hints
===============

n/a


Index: server_stats.cpp
===================================================================
RCS file: /cvsroot/server/engine/context/server_stats.cpp,v
retrieving revision 1.37.6.16
retrieving revision 1.37.6.17
diff -u -d -r1.37.6.16 -r1.37.6.17
--- server_stats.cpp	17 Aug 2007 07:11:58 -0000	1.37.6.16
+++ server_stats.cpp	31 Aug 2007 01:33:57 -0000	1.37.6.17
@@ -52,6 +52,7 @@
 , m_ulPlayTime(0)
 , m_ulAvgBitrate(0)
 , m_ulEstPlayerBufferUnderruns(0)
+, m_ulSwitchCount(0)
 , m_bEndFlag(FALSE)
 {
 }
@@ -634,6 +635,26 @@
    
 }
 
+///////////////////////////////////////////////////////////////////////////////
+// IHXClipStats::GetSwitchCount()
+///////////////////////////////////////////////////////////////////////////////
+
+STDMETHODIMP_(UINT32)
+ClipStats::GetSwitchCount()
+{
+    return m_ulSwitchCount;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// IHXClipStats::SetSwitchCount()
+///////////////////////////////////////////////////////////////////////////////
+
+STDMETHODIMP
+ClipStats::SetSwitchCount(UINT32 ulSwitchCount)
+{
+    m_ulSwitchCount = ulSwitchCount;
+    return HXR_OK;
+}
 
 ///////////////////////////////////////////////////////////////////////////////
 // IHXClipStats::SetEstPlayerBufferUnderruns()
@@ -710,7 +731,6 @@
 , m_ulPreDataTime(0)
 , m_ulPreDataBytes(0)
 , m_ulPrerollInMsec(0)
-, m_ulSwitchCount(0)
 , m_pSessionControlId(NULL)
 , m_pClip(NULL)
 {
@@ -1961,27 +1981,6 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-// IHXSessionStats3::GetSwitchCount()
-///////////////////////////////////////////////////////////////////////////////
-
-STDMETHODIMP_(UINT32)
-SessionStats::GetSwitchCount()
-{
-    return m_ulSwitchCount;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// IHXSessionStats3::SetSwitchCount()
-///////////////////////////////////////////////////////////////////////////////
-
-STDMETHODIMP
-SessionStats::SetSwitchCount(UINT32 ulSwitchCount)
-{
-    m_ulSwitchCount = ulSwitchCount;
-    return HXR_OK;
-}
-
-///////////////////////////////////////////////////////////////////////////////
 // IHXSessionStats3::GetSessionControlId()
 ///////////////////////////////////////////////////////////////////////////////
 


_______________________________________________
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