JanSrp / command

CMD,SQL
1 stars 0 forks source link

Proces Duration\trvání #11

Open JanSrp opened 2 years ago

JanSrp commented 2 years ago

select top (1000) [JOB_ID] ,[CREATION_TIME] ,[FINISH_TIME] ,[PROCESS_ID] ,[PROCESS_NAME] ,[VERSION] ,Duration = datediff(s,[CREATION_TIME],[FINISH_TIME]) FROM [dbo].[FINISHED_JOB] where [PROCESS_NAME] = 'IS_PostValidDuplicity' and [CREATION_TIME] between DATEADD(day,-5,getdate()) and getdate() order by Duration desc

;with CTE as ( select [JOB_ID] ,[CREATION_TIME] ,[FINISH_TIME] ,[PROCESS_ID] ,[PROCESS_NAME] ,[VERSION] ,Duration = datediff(s,[CREATION_TIME],[FINISH_TIME]) FROM [dbo].[FINISHED_JOB] where [PROCESS_NAME] = 'IS_PostValidDuplicity' and [CREATION_TIME] between DATEADD(day,-5,getdate()) and getdate() ) select avg(duration) ,min(duration) ,max(duration) ,STDEV(duration) ,STDEVP(duration) from CTE

;select[JOB_ID] ,[NODE_NAME] ,[SET_TIME] ,[TIME_PENDING_IN_SECS] ,[TIME_SPENT_IN_SECONDS] ,[WORKING_TIME_PENDING_IN_SECS] ,[WORKING_TIME_SPENT_IN_SECONDS] FROM [dbo].[FINISHED_JOB_HISTORY] where [JOB_ID] = 0xEDAB31F4E63F11EC81E7005056B91942