Results 1 to 9 of 9

Thread: Logging HLS Chunk requests.

  1. #1
    Join Date
    Aug 2013
    Posts
    2

    Default Logging HLS Chunk requests.

    Hello,

    In order to get the statistics that we want we need to log requested (Yes requested, not listned to. ) chunks.

    We have found out how to use onDestroy to get the the amount of data sent during the session, but that doesn't really cut it.

    Is there a way to trigger a custome module method on each chunk request?

    Regards Martin

  2. #2
    Join Date
    May 2013
    Posts
    680

    Default

    Hello Martin,

    It sounds like you are just looking to get the totals by stream of data sent but more frequently than just when onDestroy is called. With that said, one approach you could take is to check (via separate thread) incrementally for the given streams data out. You could iterate through each stream and utilize IOPerformanceCounter to get the current bytes out total.

  3. #3
    Join Date
    Aug 2013
    Posts
    2

    Default

    Hello Matt,

    We are interested in knowing which part of the streams are played. And the requested chunks are a good enough approximation for this. We are really hoping to be able to do this from within Wowza instead of intercepting the http request outside of Wowza.

    Regards Martin

  4. #4
    Join Date
    May 2013
    Posts
    680

    Default

    Hey Martin,

    Can you tell me more about what you are ultimately trying to achieve? Is it just more frequent updates of bytes out? Are you saving the information locally or remotely?

    Matt

  5. Default

    Hello Matt, Martin

    Could the IHTTPStreamerCupertinoVODActionNotify2 interface help in this matter?

    Karel

  6. #6
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Karel,

    onFillChunkEnd() fires for every chunk and has some data like stopTimecode, but I don't see how to associate that with a session. There is an example here

    I'm not sure if there a way to get what you want, exactly. There are totals in the logs per session, including sc-bytes (server to client bytes) and x-duration. For billing purposes that should be all you need.

    Richard

  7. Default

    Well, since the onCreate, onOpen, etc. methods have a reference to the IHTTPStreamerSession, I wondered if it somehow would be possible to tie this to the onFillChunkEnd() and find out which session the chunks were sent to. The most important data would be the httpStreamerSession.getQueryStr().

    What we want to know is not only how many chunks or bytes were sent but also which part of the file.

  8. #8
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    You can use WMSProperties on the IHTTPStreamerCupertinoIndex. Like this:

    package test;
    
    import com.wowza.wms.httpstreamer.model.*;
    import com.wowza.wms.logging.WMSLoggerFactory;
    import com.wowza.wms.module.*;
    import com.wowza.wms.amf.*;
    import com.wowza.wms.application.*;
    import com.wowza.wms.httpstreamer.cupertinostreaming.file.*;
    import com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.*;
    import com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.*;
    import com.wowza.wms.httpstreamer.cupertinostreaming.util.CupertinoEncInfo;
    import com.wowza.wms.media.mp3.model.idtags.*;
    
    public class ModuleCupertinoVODOnTextToID3 extends ModuleBase
    {
    	class VODActionNotify implements IHTTPStreamerCupertinoVODActionNotify2
    	{
    		IApplicationInstance appInstance = null;
    		
    		public VODActionNotify(IApplicationInstance appInstance)
    		{
    			this.appInstance = appInstance;
    		}
    		
    		public void onCreate(IHTTPStreamerCupertinoIndex fileIndex, IHTTPStreamerApplicationContext appContext, IHTTPStreamerSession httpStreamerSession, String rawStreamName, String streamExt, String streamName)
    		{
    			fileIndex.getProperties().setProperty("QueryStr", httpStreamerSession.getQueryStr());
    		}
    
    		public void onInit(IHTTPStreamerCupertinoIndex fileIndex, IHTTPStreamerApplicationContext appContext, IHTTPStreamerSession httpStreamerSession, String rawStreamName, String streamExt, String streamName)
    		{
    		}
    
    		public void onOpen(IHTTPStreamerCupertinoIndex fileIndex, IHTTPStreamerApplicationContext appContext, IHTTPStreamerSession httpStreamerSession, String rawStreamName, String streamExt, String streamName)
    		{
    		}
    
    		public void onIndex(IHTTPStreamerCupertinoIndex fileIndex, IHTTPStreamerApplicationContext appContext, IHTTPStreamerSession httpStreamerSession, String rawStreamName, String streamExt, String streamName)
    		{	
    		}
    
    		public void onFillChunkStart(IHTTPStreamerCupertinoIndex fileIndex, IHTTPStreamerCupertinoIndexItem item, LiveStreamPacketizerCupertinoChunk chunk, boolean audioOnly)
    		{
    			WMSProperties props = fileIndex.getProperties();
    			WMSLoggerFactory.getLogger(null).info("QueryStr: " + props.getPropertyStr("QueryStr"));
    			
    		}
    
    		public void onFillChunkEnd(IHTTPStreamerCupertinoIndex fileIndex, IHTTPStreamerCupertinoIndexItem item, LiveStreamPacketizerCupertinoChunk chunk, boolean audioOnly)
    		{
    		}
    
    		public void onDestroy(IHTTPStreamerCupertinoIndex fileIndex)
    		{
    		}
    
    		public void onFillChunkDataPacket(IHTTPStreamerCupertinoIndex fileIndex, IHTTPStreamerCupertinoIndexItem item, LiveStreamPacketizerCupertinoChunk chunk, boolean audioOnly, AMFPacket packet, ID3Frames id3Frames)
    		{
    		}
    	}
    
    	public void onAppStart(IApplicationInstance appInstance)
    	{
    		while(true)
    		{
    			IHTTPStreamerApplicationContext appContext = appInstance.getHTTPStreamerApplicationContext("cupertinostreaming", true);
    			if (appContext == null)
    				break;
    			
    			if (!(appContext instanceof HTTPStreamerApplicationContextCupertinoStreamer))
    				break;
    			
    			HTTPStreamerApplicationContextCupertinoStreamer cupertinoAppContext = (HTTPStreamerApplicationContextCupertinoStreamer)appContext;
    			cupertinoAppContext.addVODActionListener(new VODActionNotify(appInstance));
    			break;
    		}
    		
    		getLogger().info("ModuleCupertinoVODOnTextToID3.onAppStart["+appInstance.getContextStr()+"]");
    	}
    }
    Richard

  9. #9
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    The essential parts:

    		public void onCreate(IHTTPStreamerCupertinoIndex fileIndex, IHTTPStreamerApplicationContext appContext, IHTTPStreamerSession httpStreamerSession, String rawStreamName, String streamExt, String streamName)
    		{
    			fileIndex.getProperties().setProperty("QueryStr", httpStreamerSession.getQueryStr());
    		}
    
    
    		public void onFillChunkStart(IHTTPStreamerCupertinoIndex fileIndex, IHTTPStreamerCupertinoIndexItem item, LiveStreamPacketizerCupertinoChunk chunk, boolean audioOnly)
    		{
    			WMSProperties props = fileIndex.getProperties();
    			WMSLoggerFactory.getLogger(null).info("QueryStr: " + props.getPropertyStr("QueryStr"));
    			
    		}
    Richard

Similar Threads

  1. Remove query parameters from HLS chunk URLs?
    By johnsterling in forum Live Streaming and Encoder Discussion
    Replies: 2
    Last Post: 11-23-2016, 09:53 AM
  2. what is default chunk size for HLS?
    By dirtystar in forum General Forum
    Replies: 3
    Last Post: 03-25-2014, 04:49 AM
  3. hls skipping redownloads chunk
    By arpan_synapse in forum Performance Tuning Discussion
    Replies: 1
    Last Post: 08-06-2013, 03:41 AM
  4. disable chunk logging?
    By jweather in forum General Forum
    Replies: 3
    Last Post: 05-14-2013, 06:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •