Jump to content


Photo

Playback Reporting Plugin


  • Please log in to reply
144 replies to this topic

#1 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5619 posts
  • Local time: 06:50 AM

Posted 05 May 2019 - 09:22 PM

Playback Reporting Plugin
 
The Playback Reporting plugin can help you track user playback activity. The plugin keep track of what is being played, by who, from where, using what client and what playback method was used.

This information can help you work out what is the most popular content and what users are playing the most.
 
Attached File  user_chart.png   37.37KB   18 downloadsAttached File  resource_usage.png   330.21KB   16 downloadsAttached File  playback_reporting_resources.png   305.68KB   8 downloadsAttached File  playback_reporting_breakdown_01.png   55.08KB   8 downloadsAttached File  playback_reporting_usage_01.png   251.58KB   8 downloads
 
Version 1.5
 - add compatibility to Server Beta 4.2
 
Version 1.4
 - add cpu and memory monitoring
 
Version 1.3
 - simplified playback monitor system

Some SQL Queries

 

if your storage table got replaced due to a schema change use the following to copy your old data into the new table

SELECT name FROM sqlite_master
INSERT INTO PlaybackActivity SELECT *, 0 FROM PlaybackActivity_<TIME STAMP>

use this to update old paused data to zero

UPDATE PlaybackActivity SET PauseDuration = 0 WHERE PauseDuration is null


 


Edited by TeamB, 25 June 2019 - 06:45 PM.

  • Oxide likes this

#2 Floflobel OFFLINE  

Floflobel

    Advanced Member

  • Members
  • 192 posts
  • Local time: 10:50 PM

Posted 06 May 2019 - 07:32 AM

It's an excellent plugin that I use regularly.
Is it possible to add an option to see the number of stream at the points displayed when using the resources?
This would allow a comparison between the CPU load and the RAM, compared to the number of users watching a streaming at this time.


#3 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5619 posts
  • Local time: 06:50 AM

Posted 06 May 2019 - 07:51 AM

It's an excellent plugin that I use regularly.
Is it possible to add an option to see the number of stream at the points displayed when using the resources?
This would allow a comparison between the CPU load and the RAM, compared to the number of users watching a streaming at this time.

Yes that is one of the things I was going to look at.
Resource monitoring is still very new and experimental, it is actually hard to do across all platforms, I am still waiting for more feedback on how well if at all it works on all the target platforms the Emby server runs on.
  • Floflobel likes this

#4 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 3284 posts
  • Local time: 09:50 PM
  • LocationWarrington,UK

Posted 06 May 2019 - 09:42 AM

just trying 1.4.1 and the memory graph is not showing the correct memeory load of the server - its approx half what the true load is compared to task manager

 

what memory values are you collecting?

 

this is on 2012r2


Edited by PenkethBoy, 06 May 2019 - 09:42 AM.


#5 Schimi OFFLINE  

Schimi

    Advanced Member

  • Members
  • 177 posts
  • Local time: 10:50 PM
  • LocationWillich, Germany

Posted 06 May 2019 - 02:38 PM

24h format would be great :-)



#6 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5619 posts
  • Local time: 06:50 AM

Posted 06 May 2019 - 04:00 PM

just trying 1.4.1 and the memory graph is not showing the correct memeory load of the server - its approx half what the true load is compared to task manager
 
what memory values are you collecting?
 
this is on 2012r2

This might be due the permissions, the plugin can only collect what it can access. Try running the service with admin right and see if that changes the numbers.

#7 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 3284 posts
  • Local time: 09:50 PM
  • LocationWarrington,UK

Posted 07 May 2019 - 12:53 AM

Already is running as with admin rights

 

any other ideas?



#8 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5619 posts
  • Local time: 06:50 AM

Posted 07 May 2019 - 02:31 AM

I have split out the code that does the Process monitoring to a console app, it is attached, extract it and run it on the server, it should output the same data the plugin produces.
It will be interesting to see what the numbers look like.

Extract it and run Monitor.exe

it will produce some lines like this

Press any key to stop
ResourceMonitoringTask : Started
CPU: 0 Mem: 9309421568 P_count: 100 P_error: 156 core: 8
CPU: 15.6075482195041 Mem: 9321603072 P_count: 100 P_error: 156 core: 8
CPU: 15.6297992516304 Mem: 9304498176 P_count: 100 P_error: 158 core: 8
CPU: 15.1006649732899 Mem: 9283399680 P_count: 100 P_error: 158 core: 8
CPU: 15.4145606850298 Mem: 9270517760 P_count: 100 P_error: 158 core: 8
CPU: 16.488151569818 Mem: 9261641728 P_count: 100 P_error: 158 core: 8
CPU Average : 13.040120783212 MEM Average : 9291846997.33333
CPU: 15.3678255555765 Mem: 9273069568 P_count: 100 P_error: 158 core: 8

It takes a sample every 10 seconds and then every 60 sec it will tdo an average calc and that is what is stored.

Attached Files


Edited by TeamB, 07 May 2019 - 02:34 AM.


#9 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 3284 posts
  • Local time: 09:50 PM
  • LocationWarrington,UK

Posted 07 May 2019 - 06:03 AM

5cd15753c96e6_Annotation.png

 

this is what i get - dont have (or need :) ) the full netcoreapp runtime on my machines



#10 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5619 posts
  • Local time: 06:50 AM

Posted 07 May 2019 - 07:29 AM

I will add more logging to the plugin to monitor this in the Emby Server Logs.

 

I could just make it monitor just the Emby processes, that might be more reliable as they should all be child processes of the main app and accessible.

 

Also when I mentioned before you need to run as admin to see all the running processes on the system, I did not mean a user with admin privileges, I meant, right click the "Emby Server" start menu item and selected "Run as Administrator"



#11 Ninko OFFLINE  

Ninko

    Advanced Member

  • Members
  • 108 posts
  • Local time: 09:50 PM

Posted 07 May 2019 - 08:26 AM

Don't know if it's just me but I've noticed your plugin seems to be reporting things as direct stream when in fact they are directly playing.

#12 Floflobel OFFLINE  

Floflobel

    Advanced Member

  • Members
  • 192 posts
  • Local time: 10:50 PM

Posted 07 May 2019 - 12:47 PM

I can not find the other topic of the plugin so I post another idea here. Is it possible to have download statistics?



#13 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5619 posts
  • Local time: 06:50 AM

Posted 07 May 2019 - 04:39 PM

Don't know if it's just me but I've noticed your plugin seems to be reporting things as direct stream when in fact they are directly playing.

Do you have an SMB (windows share) or NFS (unix) share set up that your clients play media from?

Direct Playing is only when your client directly loads the file and plays it in place from a share or local file.

If your client is using HTTP even if it is just directly copying the data from your server to your client over HTTP that is still streaming and the plugin reports it so.

Direct Streaming is when the file is streamed as is with no changes over HTTP.

What makes you think you are Direct Playing your files.



#14 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5619 posts
  • Local time: 06:50 AM

Posted 07 May 2019 - 04:40 PM

I can not find the other topic of the plugin so I post another idea here. Is it possible to have download statistics?

Yes this is the new main topic now.

 

I will look into downloads and trans-coding jobs.



#15 Ninko OFFLINE  

Ninko

    Advanced Member

  • Members
  • 108 posts
  • Local time: 09:50 PM

Posted 07 May 2019 - 04:47 PM

I'm running Emby on a Synology NAS.

I'm going by what it says on the dashboard, it says Direct Play.
  • horstepipe likes this

#16 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5619 posts
  • Local time: 06:50 AM

Posted 07 May 2019 - 05:09 PM

I'm running Emby on a Synology NAS.

I'm going by what it says on the dashboard, it says Direct Play.

 

The Dashboard reports anything that is not altered i.e. directly streamed over HTTP as Direct Play.

The play session that the plugin is monitoring has extra info and what the Plugin reports is what is directly from the playback session the Emby Server gives it. No extra logic is applied.

As you have noticed the Dashboard does apply some logic to group the play method types up a little, I dont think that is a good idea and report exactly what the server is doing.



#17 saed OFFLINE  

saed

    Advanced Member

  • Members
  • 71 posts
  • Local time: 10:50 PM

Posted 08 May 2019 - 05:04 PM

Hello,
I want to say that it is an excellent plugin, which makes Emby even bigger.
 
I am using it in ubuntu, at the moment I do not see any problem.
 
One of the important things for me is the monotorizacion of CPU and Memory, is it possible to know in the highest points of CPU consumption the number of simultaneous users?
 
Is it possible to start the monotorization time? that is, more than 24 hours. like for example a week
 
regards


#18 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5619 posts
  • Local time: 06:50 AM

Posted 08 May 2019 - 08:17 PM

I want to say that it is an excellent plugin, which makes Emby even bigger. 
I am using it in ubuntu, at the moment I do not see any problem.

Thank you for the feedback, I am glad it is working for you on Ubuntu, it is always good to get feedback from people when things are working, usually it is just feedback when things are broken but it is also important to know where it is working.
 

One of the important things for me is the monotorizacion of CPU and Memory, is it possible to know in the highest points of CPU consumption the number of simultaneous users?

As mentioned above when I get more feedback on this and can confirm it it is working correctly I will be adding a streaming count to the charts as well which will show how many active users and streams are currently being played.

So far I have received one report CPU and Memory monitoring does not work and one report (yours) saying it does work which is not conclusive. I will need more feedback and that might take a while given the user base is not very active these days.

Yes eventually this will be added or if monitoring is not working it will be stripped out of the plugin.
 

Is it possible to start the monotorization time? that is, more than 24 hours. like for example a week


This is still experimental, perhaps when it is shown to work consistently on platforms more work can be done on making this persistent.
At the moment a sample is taken every 10 seconds and that is averaged out over 60 seconds, this is then stored in memory as part of the data set.

All data currently is in memory and if you restart Emby it is restart, 24 hours should be enough to check your server for any recent activity that might be causing issues. Longer than that I am not sure how useful it will be.


Edited by TeamB, 08 May 2019 - 08:19 PM.


#19 Happy2Play OFFLINE  

Happy2Play

    Trial and Error

  • Moderators
  • 14690 posts
  • Local time: 01:50 PM
  • LocationWashington State

Posted 08 May 2019 - 09:20 PM

I say it works rather well.

 

5cd37ff1738df_resources.jpg

 

Media being converted outside Emby on the same machine.

 

Windows 10

 

**So if Emby is the only thing on the machine it would give a good representation of resource usage.


Edited by Happy2Play, 08 May 2019 - 09:22 PM.


#20 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5619 posts
  • Local time: 06:50 AM

Posted 08 May 2019 - 09:37 PM

Thanks for the feedback @Happy2Play
yes this is the sort of thing I see in all my tests
So the spikes close to 100% cpu are external encoding occurring on your server?
It would be good if you could check your Mem usage is somewhat in alignment with what the actual server is reporting, an early report from a user in this thread said it was reporting about half of their memory usage compared to what the server was actually reporting.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users