14.12.3 Get Active Sessions

serverState.get("sessions") returns an array of current active sessions. Each entry contains information about a session.

{
   "session_id":"530b5f9a-75c4-4838-9cc3-44df44b035c5",
   "source":"testServerState",
   "task_timeout_ms":0,
   "idle_timeout_ms":0,
   "alive_ms":237,
   "total_analysis_time_ms":115,
   "state":"RELEASED",
   "private_graphs":[
      {
         "name":"anonymous_graph_1",
         "creation_timestamp":1589317879755,
         "is_transient":true,
         "memory":{
            "topology_bytes":46,
            "key_mapping_bytes":30,
            "persistent_property_mem_bytes":0,
            "transient_property_mem_bytes":0
         },
         "vertices_num":1,
         "edges_num":0,
         "persistent_vertex_properties":[
            
         ],
         "persistent_edge_properties":[
            
         ],
         "transient_vertex_properties":[
            
         ],
         "transient_edge_properties":[
            
         ]
      }
   ],
   "published_graphs":[
      {
         "name":"multigraph",
         "creation_timestamp":1589317879593,
         "is_transient":false,
         "memory":{
            "topology_bytes":110,
            "key_mapping_bytes":56,
            "persistent_property_mem_bytes":64,
            "transient_property_mem_bytes":0
         },
         "vertices_num":2,
         "edges_num":6,
         "persistent_vertex_properties":[
            {
               "loaded":true,
               "mem_size_bytes":16,
               "name":"tProp",
               "type":"string"
            }
         ],
         "persistent_edge_properties":[
            {
               "loaded":true,
               "mem_size_bytes":48,
               "name":"cost",
               "type":"double"
            }
         ],
         "transient_vertex_properties":[
            
         ],
         "transient_edge_properties":[
            
         ]
      }
   ]
}

The following table explains session information fields:

Table 14-6 Session Information Options

Field Description
sessionID Session' ID generated by PGX server.
source Descriptive string identifying the client session.
task_timeout_ms Timeout to interrupt long-running tasks submitted by sessions (algorithms, I/O tasks) in milliseconds. Set to zero for infinity/no timeout.
idle_timeout_ms Timeout of idling sessions in milliseconds. Set to zero for infinity/no timeout.
alive_ms Session's age in milliseconds.
total_analysis_time_ms Total session's executing time in milliseconds.
state Current session of the session can be Idle, Submitted, released or terminating.
private_graphs Session bounded graphs.
published_graphs Published graphs pointed to from the session.

Note:

The is_transient field indicates if the graph is transient. A graph is transient if it is not loaded from an external source.