Maybe I am just stupid but it seems to me that the result of the get_sessions method is not correct.
IMHO it mixes up the sessions and the threads because the same entries are shown for multiple users.
But maybe I interpreted it wrong so feel free to point me in the right direction. Or is that a case I should discuss with IBM?
[
{'ID': 2, 'Context': '', 'Active': True
, 'User':
{'Name': 'UserName01', 'FriendlyName': 'UserName01', 'Type': 'Admin', 'IsActive': True, 'Enabled': True}
, 'Threads': [
{'ID': **7060**, 'Type': 'User', 'Name': 'UserName03', 'Context': 'Architect', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 8972, 'Type': 'User', 'Name': 'UserName01', 'Context': 'TM1 Web', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''}]},
{'ID': 6, 'Context': 'TM1py', 'Active': True
, 'User':
{'Name': 'UserName02', 'FriendlyName': 'UserName02', 'Type': 'Admin', 'IsActive': True, 'Enabled': True}
, 'Threads': [
{'ID': **7060**, 'Type': 'User', 'Name': 'UserName03', 'Context': 'Architect', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 5080, 'Type': 'User', 'Name': 'UserName02', 'Context': 'TM1py', 'State': 'Run:R', 'Function': 'GET /api/v1/Sessions', 'ObjectType': 'Cube', 'ObjectName': '}ElementAttributes_}Clients', 'RLocks': 7, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 8972, 'Type': 'User', 'Name': 'UserName01', 'Context': 'TM1 Web', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''}]}
Hi @scrumthing,
TM1py only hands over what it receives from the REST API.
The nature of sessions and threads has evolved in TM1 over the APIs.
In the C API a session and a thread are essentially the same things.
In the REST API, a session can have a pool of threads running in it. The user gets a session assigned when he logs in. This session is kept for the time until he logs out. They only get a thread assigned when they are actually doing something. Once the thread is idle long enough it will be given back to the pool in TM1.
Hi @scrumthing,
The method is just giving you all the sessions and threads the instance is currently holding. Try looping through the result and you will be able to view all the sessions.
Also, you didn't mention anything about your expectation on the method.
@MariusWirtz,
I think we can basically we remove the threads in the expand query, because the threads returned are actually not grouped by sessions.

I think we can basically we remove the
threadsin theexpandquery, because the threads returned are actually not grouped by sessions.
I disagree. In the response JSON, there are threads associated with a session-id. I think it makes sense.
We should try to standardize how we add additional properties to queries. The best bet would be to mimic the set mdx function. That way if a user wants only sessions the can get it, or they can optionally include the threads. If there are <=2 properties we can add a boolean to includeThreads or not.
On Aug 19, 2020 8:08 AM, Marius Wirtz notifications@github.com wrote:
I think we can basically we remove the threads in the expand query, because the threads returned are actually not grouped by sessions.
I disagree. In the response JSON, there are threads associated with a session-id. I think it makes sense.
-
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com/cubewise-code/tm1py/issues/340#issuecomment-676484214, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEK7GZQCR76HLDXLD5VXK2LSBPTC7ANCNFSM4QE7UX7Q.
This is the query result for my session. Now, why does Threads key has threads related to other users?
Do they signify something?
{'ID': 33993,
'Context': 'TM1py',
'User': {'Name': 'myCAMID', 'FriendlyName': 'rkvinoth', 'Type': 'Admin', 'IsActive': True, 'Enabled': True},
'Threads':
[{'ID': 19840, 'Type': 'User', 'Name': 'user1', 'Context': '', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 10972, 'Type': 'User', 'Name': 'user2', 'Context': 'Architect', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 37908, 'Type': 'User', 'Name': 'user3', 'Context': '', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 11472, 'Type': 'User', 'Name': 'user4', 'Context': 'Architect', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 27300, 'Type': 'User', 'Name': 'rkvinoth', 'Context': 'Architect', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 28876, 'Type': 'User', 'Name': 'user6', 'Context': '', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 13092, 'Type': 'User', 'Name': 'user7', 'Context': '', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 10024, 'Type': 'User', 'Name': 'user8', 'Context': '', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 14492, 'Type': 'User', 'Name': 'user9', 'Context': 'Architect', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 38124, 'Type': 'User', 'Name': 'user10', 'Context': '', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''}]}
I know session management had a lot of updates from 2.08 onwards so this could be part of that
Ryan Clapp
Sr. Manager
AWS FinTech
Sent from my mobile device
On Aug 19, 2020 8:20 AM, Vinoth Kumar Ravi notifications@github.com wrote:
This is the query result for my session. Now, why does Threads key has threads related to other users?
Do they signify something?
{'ID': 33993,
'Context': 'TM1py',
'User': {'Name': 'myCAMID', 'FriendlyName': 'rkvinoth', 'Type': 'Admin', 'IsActive': True, 'Enabled': True},
'Threads':
[{'ID': 19840, 'Type': 'User', 'Name': 'user1', 'Context': '', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 10972, 'Type': 'User', 'Name': 'user2', 'Context': 'Architect', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 37908, 'Type': 'User', 'Name': 'user3', 'Context': '', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 11472, 'Type': 'User', 'Name': 'user4', 'Context': 'Architect', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 27300, 'Type': 'User', 'Name': 'rkvinoth', 'Context': 'Architect', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 28876, 'Type': 'User', 'Name': 'user6', 'Context': '', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 13092, 'Type': 'User', 'Name': 'user7', 'Context': '', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 10024, 'Type': 'User', 'Name': 'user8', 'Context': '', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 14492, 'Type': 'User', 'Name': 'user9', 'Context': 'Architect', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''},
{'ID': 38124, 'Type': 'User', 'Name': 'user10', 'Context': '', 'State': 'Idle', 'Function': '', 'ObjectType': '', 'ObjectName': '', 'RLocks': 0, 'IXLocks': 0, 'WLocks': 0, 'ElapsedTime': 'P0DT00H00M00S', 'WaitTime': 'P0DT00H00M00S', 'Info': ''}]}
-
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/cubewise-code/tm1py/issues/340#issuecomment-676491177, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEK7GZT3UOEIAZMD7QCHEN3SBPUP5ANCNFSM4QE7UX7Q.
This is the query result for my session. Now, why does
Threadskey has threads related to other users?
Do they signify something?
That's odd. I get a completely different picture on 11.8.00100.13. My threads are grouped by the sessions.
What version are you on?
I'm living with 11.4.00009.4 and as @rclapp pointed out, this could be because of newer updates.
Woah, guys that was fast. Yes @rkvinoth that was my point as well. Sessions are not grouped by user in my version and I would expect that.
So it's related to the TM1 version.
I will close this issue then.
Make sense, this probably some of the reasons why Pulse 6.0 needs the newest server version.
From: Marius Wirtz notifications@github.com
Sent: Wednesday, August 19, 2020 9:07 AM
To: cubewise-code/tm1py tm1py@noreply.github.com
Cc: Clapp, Ryan rdclapp@amazon.com; Mention mention@noreply.github.com
Subject: Re: [cubewise-code/tm1py] Problem with result of get_sessions (#340)
Closed #340https://github.com/cubewise-code/tm1py/issues/340.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/cubewise-code/tm1py/issues/340#event-3671590646, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEK7GZS73XTRW7TPAXQAGG3SBP2DDANCNFSM4QE7UX7Q.