In which database table in the K2 db can the time spent in Sleep be found?

  • 23 April 2014
  • 1 reply
  • 1 view

Badge +2

We're trying to retrieve the time spent in Sleep in activities from the ServerLog tables.

so far we've only be able to find processes in sleep in the [Server] tables during an active sleep.

 

In the [ServerLog].[Status] we can see an status called "Sleep" related to Slot and Worklist, but we never see any related records in any other tables.

 

Should we expect records to be created in the ServerLog tables when sleep completes? Or should it be retrieved somewhere else?


1 reply

Badge +9

The short answer here is that the value you seek is not stored anywhere in the server. When a process goes to sleep the Store Procedures kick it into the [ServerLog].[ActInstAudit] with a time stamp of when the process went to sleep. It also gets stored in the [Server].[Async] data table with a time stamp for when it is scheduled to wake. With these two data tables we can compute the duration the process was asleep. The problem is that when the process resumes the store procedure that governs waking processes will kick it out of the [Server].[Async] data table.

What you could do to get the sleep duration is create your own Stored Procedure that collects the initial time of sleep from the [ServerLog].[ActInstAudit] table along with the estimate end time of sleep for that process from the [Server].[Async] data table and store both of those in a new data table. From here you could just subtract the two and get the sleep duration of a given process.

Hope this was helpful,
Austin

Reply