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

7 comments

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

0

Yes. I don't see how I can export the rows of data into a CSV, XML, etc.

0

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

0

Is the access to the internal database documented?

0

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.

0

Realtime response.. I love it..

How do I do this for now then? How do I access the database?  The internal one..

0

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.

0

Please sign in to leave a comment.