You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I built this query for LuK3, which should be usable as a starting point query.
WITH
targetqueue AS (SELECT'Deferred to proxy check' target),
queuetime AS (
SELECT id, name, date, SUM(TIMESTAMPDIFF(SECOND, entrytime, exittime)) duration, COUNT(1) deferrals
FROM (
SELECTr.id,
r.name,
r.date,
lstart.timestampAS entrytime,
lend.timestampAS exittime,
CASE WHEN MIN(lend.timestamp) OVER (PARTITION BY r.id, lstart.timestamp) =lend.timestamp THEN 1 ELSE 0 END AS selector
FROM request r
INNER JOIN log lstart ONr.id=lstart.objectidANDlstart.objecttype='Request'INNER JOIN log lend ONr.id=lend.objectidANDlend.objecttype='Request'ANDlend.timestamp>lstart.timestampWHERElstart.action= (SELECT target FROM targetqueue)
AND (lend.actionLIKE'Deferred to %'ORlend.actionLIKE'Closed %')
AND (lend.action<> (SELECT target FROM targetqueue))
) cudeferrals
WHERE selector =1GROUP BY id, name, date
),
activemonths AS (
-- Pull all values from two generated sequences (values 2008 to 2050, and values 1 to 12) to generate dates.-- Filter the resulting set down to months between the earliest and latest log entries.-- This gives us a complete list of all months when the tool has been active, even if there was no activity on the-- tool for a specific monthSELECT (y.seq*100) +m.seqAS sortkey
FROM seq_2008_to_2050 y
CROSS JOIN seq_1_to_12 m
WHERE (y.seq*100) +m.seq>= (SELECTMIN(EXTRACT(YEAR_MONTH FROMtimestamp)) FROM log WHEREtimestamp>0AND action = (SELECT target FROM targetqueue))
AND (y.seq*100) +m.seq<= (SELECTMAX(EXTRACT(YEAR_MONTH FROMtimestamp)) FROM log WHEREtimestamp>0)
)
SELECT data.*FROM activemonths
LEFT JOIN (
SELECT EXTRACT(YEAR_MONTH FROMdate) month, AVG(duration) average, STDDEV(duration) stddev, COUNT(duration) requests, SUM(deferrals) deferrals
FROM queuetime
GROUP BY EXTRACT(YEAR_MONTH FROMdate)
) data ONdata.month=activemonths.sortkey;
The ask in this issue is to wrap this into a stats page, allowing the user to choose the queue (except the default queue) to retrieve the stats for (or just iterate over all non-default queues). The results can then be shown in a table and/or graphed to make it look pretty.
Possible extensions:
Add a month-to-month delta for each line)
Produce something similar for the default queue. This will need fancier logic though.
Consider the edge case of requests being deferred into a queue before email confirmation
The text was updated successfully, but these errors were encountered:
I built this query for LuK3, which should be usable as a starting point query.
The ask in this issue is to wrap this into a stats page, allowing the user to choose the queue (except the default queue) to retrieve the stats for (or just iterate over all non-default queues). The results can then be shown in a table and/or graphed to make it look pretty.
Possible extensions:
The text was updated successfully, but these errors were encountered: