How do we track time of guacamole rdp session? - rdp

Actually, I have a scenario where I want my user to be able to use my guacamole service to connect the RDP for 5 hours free. After that, I wanted to charge so I wanted to track down the usage time of the user. Is there any official parameter to set or some API that can help?
I first time using guacamole so have no idea about it. I found a property called api-session-timeout but turns out that it was used to disconnect users after a certain time of inactivity. Whereas in my case I wanted the user to not cross 5 hours. The sessions can also be broken into minutes or hours. I just want to get data on login and logout so I can count 5 hours of usage.

Related

How to calculate Session Duration or Call Duration for a session ID in TokBox API?

How to calculate Session Duration or Call Duration in TokBox API?
We need to display Session/Call duration for each Session-Id, we created from Backend. In our case, only 2 people can connect to a session as we are sharing session-id & token with two users only. Now On the Admin Panel, we need the Actual Call time between these two users.
Is there any API which provides these statics?
There is no such API to calculate the exact call duration.
You can check your invoices on the dashboard under the billing section.
Another way is, you can log the timestamps on event listeners. Like when the first-person joins the session, connectionCreated event gets fired, in that you can log your time stamp and send it to your server. Similarly, when someone leaves the session, you get connectionDestroyed event. Refer to this page for all events related to the session.
You can also refer to our Session Monitoring API - https://tokbox.com/developer/guides/session-monitoring/ which lets you receive real-time session callback events on your server endpoint thereby monitoring the user's session activity.
By using the events mentioned above you can calculate the session duration.
Thanks!

how to find out how long visitors stay on my website(duration time)

I'm making a simple analytics admin assuming I'm the owner of a shopping mall as my first project
I've looked up a lot about it but, I couldn't find any information. What I've found out so far is that most existing marketing toole uses cookie and they caclulates it in some ways like they set some cookie with current time and set another cookie when users move to another page on website.
My website is made of AJAX and expressjs with mysql and I'll send user's average duration time to my admin page
Could anyone tell me how to track duration time?
I'm definitely not distributing the idea but it is only for my team prject
This could be accomplished with a combination of localStorage (optionally) and onbeforeunload.
Set the current time when a user first gets to site
Store it in localstorage
When they are about to leave, onbeforeunload, you can save / calculate the duration
https://developer.mozilla.org/en-US/docs/Web/API/Storage/LocalStorage
https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload

Firebase User Engagement Calculation

I am trying to wrap my head around the Firebase User Engagement Calculation. I am doing a lot of debugview testing now, and as the online documentation states (https://support.google.com/firebase/answer/6317485), Firebase is firing the user_engagement event by default on a periodic basis within a session while the app is in the foreground.
What I have seen thusfar is that user_engagement is fired quite reliably in the beginning and end of an engagement (this can be occurring multiple times in a specific session).
Scenario:
Say for instance I started my session and exited the app, but returned again within the the same 30 minutes time slot. The session_start won't fire again, but only user_engagement. This is quite clever, because I can actually then query first and last engagement experienced within this scenario.
My question is:
How would I actually then query the difference between the beginning of a user_engagement and end of the user engagement ? Currently engagement_time_msec allows me to measure: The additional engagement time (ms) since the last user_engagement event (https://support.google.com/firebase/answer/7061705?hl=en), and not since the beginning of the user_engagement. What if I wanted to measure engagement from the first engagement and last engagement, assuming my specific scenario describe earlier. The idea of this question is to ask how would an example query look like to address this question.
Since I posted this question, I found it would be a lot wiser to look at Session Duration and not Duration between User Engagement Events.
As far as I know, one can not update settings of the user_engagement event, but one can however determine when a session should start (after 0, 5, 10, 15, etc seconds) and b) when a session should end (after 10, 30, 60, etc minutes of inactivity).
To help you get started here is great examples:
How to calculate Session and Session duration in Firebase Analytics raw data?
Session Calculations
Session-Duration Distribution-table in Firebase
Sessions-per-User Distribution-table in Firebase
Important: a Firebase session starts by default after at least 10s since a user_engagement event was triggered (and a session ends after a period of at least 30 minutes of no triggers of user_engagement). And so, whenever users use your app for a period of less than 10s, you will accrue user engagement without a session. This typically means that you will have higher active user base in your dashboard, than users which started a session under your Firebase Events'-tab.

Calculate Daily Active Users with Devise

Iam a RoR developer and I want to calculate DAU for my website. By DAU I mean:
DAU- Total Number of users who either came to my website and logged in or who came to the website and were already logged in.
I implemented Devise in my website because it tracks current_sign_in_at. And later found that these attributes mean as:
current_sign_in_at - The latest time the person logged in to my website.
(Using this I can get the count of people who came to my website and logged in.)
But I am missing the count of people who came to the website and were already logged in.
One of the way I found to implement it is trigger a function in delayed job which updates the timestamp whenever the root action is called and home page of my website loads. But since my website gets around 1000 - 2000 hits per minute I guess this function will become the bottleneck.
Can anyone please suggest me the best way to implement it.
Many Thanks.
Possible solutions:
Use a service like Google Analytics(custom variables), KISSmetrics(visitor identity) or Mixpanel(distinct_id) and send them the user id and you can find daily active users.
You can do something like what you mentioned, store the last active time for the user in a database each time you get a request, if you get 1000-2000 hits per minute, you might want to store it in an in memory store like redis instead. If users will be coming to your website from different paths and not just root url you could create a after_filter in the application controller which updates the redis store with the current time for the user.
If you are interesting in looking at more then just the daily active users in future, it is worthwhile to create a log for your users in another database. Again I'd suggest an before or after_filter in application_controller which queues a job to store time, user_id, any other data you might be interested in. I'm using a mongo db separate from my ActiveRecord MySQL database to do this.

Fetching data via Facebook connect taking over 10 seconds

Our site uses Facebook connect. When a new user signs up we ask for permission to pull their interest data, their list of friends, and their friends' interests. Fetching this data used to be a very quick process (couple seconds). Over the last week or so, the time to fetch this data has increase to 10+ seconds. According to Facebook insights, our site is not being throttled. We didn't make any changes to our site.
Anyone else experiencing this issue with Facebook? Have any ideas for how to address it?
Thanks!
As of 1/26 at 7:55 PM EST, the live status page doesn't indicate any irregular activity.
Sometimes this occurs because a user simply has a lot of likes and interests. I would recommend making this operation asynchronous following a flow something like this:
User connects with your app
Get the access token and store it in a queue that a background process can access.
Get all the information you need immediately to make the app work.
Some time later
In a background process, grab an access token from the queue, parse it and handle it however you'd like.
A simpler, although less stable option, is redirecting the user to a page upon installation which makes an AJAX request to that page telling it to download the information from the graph. This keeps the response time low, but does require your user to have Javascript enabled and for them to stay on the destination page long enough for the request to be created.