How to count totoal minutes code server has been open in multiple tabs #4664
Replies: 4 comments 2 replies
-
Hmm... @simonjcarr since Linux is predominantly used in deployed containers, although this might work on OSX, you could try making a stopwatch script using SH and run it from |
Beta Was this translation helpful? Give feedback.
-
Great question! @code-asher what do you think? |
Beta Was this translation helpful? Give feedback.
-
The requirement to count multiple connections separately makes it a bit
tricky. Maybe the best way would be to create an extension that keeps
track since there will be one extension host per connection.
Or code-server could be wrapped in an iframe and some code could be
added to track that connection. Or create a proxy that sits in front of
code-server and tracks open connections (there are two per page but they
can be distinguished with the `type` query parameter).
|
Beta Was this translation helpful? Give feedback.
-
Thanks for all the feedback guys, but never mind, I have worked out how to do it. I don't need the information across all tabs any more, so I have just added a script to my based linux image. This script is invoked every minute by cron and it posts to an api with the data from healthz. |
Beta Was this translation helpful? Give feedback.
-
I am trying to find a way to total the number of minutes a Code Server container has been in use. I want to know this across multiple tabs, so if one user has a code server session running in two tabs for 10 minutes, then I would like to count 20 minutes of usage.
I am thinking that perhaps I can write a script that runs in the background of each container sends data back to the server, but would that script run for each open window, or would only one instance of the script run even if 20 windows were open?
Beta Was this translation helpful? Give feedback.
All reactions