There is IN STATE time metric for each session in the Query Monitor in Viewpoint. The metric shows how long the query has been in the current state.
We can get all sessions by executing function SYSLIB.MonitorSession:
SELECT * FROM TABLE (MONITORSESSION(-1,'*',0)) AS T
The description of the function resultset is here:
The MONITORSESSION request returns both the PEState and AMPState response values. Viewpoint interprets the meaning of the PEState and AMPState combination, which is displayed as the session state:
But there is no field for IN STATE time value there.
Another source is the table DBC.SessionTbl but there is also no field for IN STATE time value there:
SELECT * FROM DBC.SessionInfo;
Please, how is it possible to get IN STATE value shown in the Query Monitor in Viewpoint by query?
Time IN STATE is not directly available from the API. Viewpoint calculates this value by caching the prior value and (first) corresponding collection timestamp.