Skip to content

Instantly share code, notes, and snippets.

@jesuino
Created January 15, 2021 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesuino/260362fae039ec4af9ac64e16f78e44a to your computer and use it in GitHub Desktop.
Save jesuino/260362fae039ec4af9ac64e16f78e44a to your computer and use it in GitHub Desktop.
select
pil.externalId,
pil.processId,
nid,
nodetype,
nodename,
count(nid) as total_hits,
avg(execution_time) as averageExecutionTime,
min(execution_time) as minExecutionTime,
max(execution_time) as maxExecutionTime
from(
select
max(log_date) as lastLog,
processinstanceid as piid,
nodeinstanceid as niid,
nodeid as nid,
nodetype,
nodename,
DATEDIFF(SECOND, min(log_date), max(log_date)) as execution_time
from
NodeInstanceLog
group by
processinstanceid,
nodeinstanceid,
nid
order by lastLog
)
inner join
ProcessInstanceLog pil on pil.processInstanceId = piid
group by
pil.externalId,
nid,
nodename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment