MantisBT - CDash
View Issue Details
0007499CDashpublic2008-08-18 17:212008-08-25 19:40
David Cole 
Julien Jomier 
normalfeaturealways
closedfixed 
1.2 
1.2 
0007499: Summarize busytime by site
Please add a page that allows a CDash administrator to estimate how busy each site is. The SQL query in the "additional information" field is a first attempt at approximating this information based on the difference between the buildupdate.starttime field and the build.submittime field for all submissions in the past 24 hours...

You might get a "better" estimate than this by averaging over the last 7 (or N) days, but those queries would take longer to execute...

SELECT sitename, SEC_TO_TIME(SUM(elapsed)) AS busytime, SUM(elapsed) AS busyseconds FROM
(
SELECT site.name AS sitename, project.name AS projectname, build.name AS buildname, build.type, TIME_TO_SEC(TIMEDIFF(submittime, buildupdate.starttime)) AS elapsed
FROM build, buildupdate, project, site
WHERE
  submittime > TIMESTAMPADD(HOUR, -24, NOW())
  AND buildupdate.buildid = build.id
  AND site.id = build.siteid
  AND build.projectid = project.id
ORDER BY elapsed DESC
)
AS summary
GROUP BY sitename
ORDER BY busyseconds DESC
LIMIT 200

; The LIMIT 200 clause is only so that all the results show up at once when this query is executed via phpmyadmin (rather than allowing phpmyadmin to limit it to the first 30...)
No tags attached.
Issue History
2008-08-18 17:21David ColeNew Issue
2008-08-18 17:21David ColeStatusnew => assigned
2008-08-18 17:21David ColeAssigned To => Julien Jomier
2008-08-25 19:40Julien JomierStatusassigned => closed
2008-08-25 19:40Julien JomierNote Added: 0013181
2008-08-25 19:40Julien JomierResolutionopen => fixed
2008-08-25 19:40Julien JomierFixed in Version => 1.2

Notes
(0013181)
Julien Jomier   
2008-08-25 19:40   
This is fixed in 1.2. Probably need some improvement in the future. Thanks for the code Dave!