Does anyone know or have an example how to make the script record the user peak on a channel?

So you can see on what date and time the most users were online... I have tried to find info on this kinda script but nothing usefull!

Thank in advance!