Get the Total number of active sessions

How Can I read the total number of active session in perspective? like the perspective session info page in gateway.
The [System]Gateway/Sessions/SessionCount always show 1.

Yes, I'd like to know this too!
Last I heard it was comming soon:

1 Like

This is currently going through the QA process, and will most likely be available as one of the upcoming 8.0.7 nightly builds.

The usage will boil down to system.perspective.getSessionInfo([usernameFilter], [projectName]) where usernameFilter and projectName are optional arguments to filter down the returned session objects.

2 Likes

Is this a thing yet? I’d like to have a dashboard showing the number of Vision Clients and the number of Perspective Sessions for multiple gateways. Or using this script, can scripts be fired at gateways across the network?

Sure you could use system.perspective.getSessionInfo() to get a count of active sessions. You’d want to set up some sort of timed script to trigger updates or your count won’t change as the session count changes.

If you want to send messages to other sessions you should use system.util.sendMessage("projectName", "handlerName", payload={"someKey":"someValue"}, scope="S") and the project in question will need to have a configured Message Handler under Session Events.

If the gateway with the dashboard is the EAM controller of the other gateways, as of 8.1.16 there should now be an EAM tag available to keep track of currently opened sessions on agent gateways under [System]Gateway/EAM/<agent_name>/<redundant_mode>/Metrics/Sessions

1 Like