This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
7 Replies Last post: Jun 3, 2009 7:14 PM by Pavel Sher  
Jonathan Harley Newbie 25 posts since
Dec 19, 2008
Currently Being Moderated

Jun 3, 2009 3:59 AM

Export TeamCity Statistics for All Projects?

I'd like to do some crunching on the amount of time that projects build, the number of times each project builds in a day, etc.

 

Is there a way to export the stats associated with all the builds on a given build agent?  All build agents?  Etc.?

 

Thanks -- Jon

Pavel Sher JetBrains 2,361 posts since
Mar 6, 2008
Currently Being Moderated
Jun 3, 2009 1:39 PM in response to: Jonathan Harley
Re: Export TeamCity Statistics for All Projects?

Have you seen a subtab called "Matrix" available under the Agents tab?

Pavel Sher JetBrains 2,361 posts since
Mar 6, 2008
Currently Being Moderated
Jun 3, 2009 6:50 PM in response to: Jonathan Harley
Re: Export TeamCity Statistics for All Projects?

Unfortunately CSV export is not supported at the moment, you can watch/vote for this issue: http://www.jetbrains.net/tracker/issue2/TW-5090

Statistics can be exported with help of SQL requests right from the database. There are two main tables which can be used:

- history - contains all builds history

- light_history - to this table records from history are moved during cleanup, i.e. this table contains records of removed builds

Pavel Sher JetBrains 2,361 posts since
Mar 6, 2008
Currently Being Moderated
Jun 3, 2009 7:01 PM in response to: Jonathan Harley
Re: Export TeamCity Statistics for All Projects?

No, and we can't guarantee the database schema will not be changed in the future. I can offer this solution as a workaround only.

Pavel Sher JetBrains 2,361 posts since
Mar 6, 2008
Currently Being Moderated
Jun 3, 2009 7:14 PM in response to: Jonathan Harley
Re: Export TeamCity Statistics for All Projects?

Well, it would be much simpler if you use external database like MySQL.

 

HSQLDB (default db in TeamCity) usually is running in in-process mode, unfortunately no one except TeamCity can connect to the database in this mode. However it is possible to reconfigure it to run in server mode, in this case TeamCity will communicate with database via socket, and you will be able to connet to the database with help of sql tool, read more about it here: http://hsqldb.org/web/hsqlDocsFrame.html

 

However I would consider migration to external database, simply because it is much easier to run SQL statements with, for example, MySQL then with HSQLDB (there are various SQL tools with nice GUI for MySQL or Oracle). Also even if you configure HSQLDB to run in server mode you will need to write some scripts to shutdown or start it and so on.

More Like This

  • Retrieving data ...