I’d like to implement my own statistics sytem. I’m using this code to count how many seconds user was watching video but my tests are different then reality. For example i’m watching video and shutdown player in 10 sec. but logs show me then I was watching video 15 sec. I tested this module in RTMP, RTSP na HLS streaming but always result are bad. How can I solve this problem? Maybe someone has better method to do this?
If you are looking to obtain information on a given session/client connection, you might review our serverinfo HTTP Provider source code as a starting point. There are even elapsed time and time running related functions that could be of use on a per connection basis.
Wowza Wrench has a feature that allows you to measure the elapsed time per user. It also uses client.getElapsedTime().getTimeSeconds() under the hood. When I was investigating time differences, I found that maybe connections are administered periodically in Wowza and that’s why there is a varying difference between the time you see and the time the client object reports. There are some idle* settings in VHost.xml which might have effect on this. Would be good to get some official explanation on the inaccuracy we both saw.
Can you explain why can may it be more precise withing onDisconnect…? And why we are seeing difference between the time we measure and what the client object reports…?