How is the Perspective Sessions status page info found?

On the Gateway, the Status->Connections->Perspective Sessions has a list with information about all open sessions, both designer and perspective. Is there a way to access this list, or equivalently, how is this information found in the backend?

I've been using PerspectiveSessionMonitor, InternalSessions, SessionCollection, and PerspectiveSessionInfo.

List openClients = psm.getClientSessionsForProject("ProjectName");

PerspectiveSessionMonitor psm = this.perspectiveContext.getSessionMonitor();
List openClients = psm.getClientSessionsForProject("Project")

And this can get some of the information, but not all of it. This only perspective sessions, not designers. And not in any convenient way.

But theres also PerspectiveSessionInfo.SimplifiedGsonEncoder. Which gets some of the information, but as outlined in the documentation:
Used for customer-facing encoding of this class, but not used for the status page's encoding.

So, is there an encoding that is used for the status page? Its a very specific note to include in documentation. Where does that encoding come from?

PerspectiveSessionInfo is the class, but the serialization used for the status pages is just GSON's default reflection based behavior, which doesn't care at all that all the fields in com.inductiveautomation.perspective.gateway.session.PerspectiveSessionInfo are private. That class does have all the info you need... just private. You'll have to reflect into it (or build your own GSON instance and have it reflect into it) yourself.

thanks, I'll look into that

That worked, thanks. As well, do you know how to get a list of InternalSession objects for both Client and Designer sessions thats on the status page? The getClientSessionsForProject function in PerspectiveSessionMonitor is able to get all Client sessions, but not designers. How does this page get both?

com.inductiveautomation.perspective.gateway.session.PerspectiveSessionMonitor#getSessionInfos returns all session infos, from all projects. You can just filter that result list for the project name you care about.