Build queue monitoring

I'd like to monitor build queue stats. Each push and each pop of build task to calculate build queue throughput. I tried to make it via REST, but haven't find any suitable request. I also tried to make triggers to db, but it seems like build queue comes into db via deleting and inserting whole table.
Please advise me the best method of monitoring the build_queue. If I wrong with my thoughts about db, please tell me how it really works.

7 comments
Comment actions Permalink

Hi Bulat,

We have the related feature request, please vote for it and try the suggested workaround.
If it's not what you are speaking about then please describe in more detail the result you expect to obtain.

0
Comment actions Permalink

That request is already implemented in TC, but it's functionality
differs with my needs.
I mean I want to monitor build queue in real time - each event such as incoming and outgoing config I want to count and make a graph. It will help me to detect:
- non programmers' issues in builds (fails). VCS dropouts, corrupted artifacts, etc. Lots of such failures will increase queue velocity abnormally - spikes on graph. I can't subscribe to each fail of build configuration since I have them over 6k
- efficiency of implemented changes of build configuration settings. I am trying to optimize TC to process as much build configuration as it possible in given amount of time. So I need to have a measure to check were my changes effective or not.

What I need is event driven monitoring - the build was add to queue -> I got +1 in some my system for inserted builds. The build was removed from queue (manually or passed to agent) -> I got +1 for removed builds. That's all. Time period queue checking is not acceptable because I am missing builds were processed during that time period (added and deleted)

0
Comment actions Permalink

Judging from your specific case I would recommend you to write a TC plugin that will exactly match your needs. You can find many examples here: https://github.com/JetBrains/?query=teamcity. Basically what you need is to subscribe to server event listener and catch necessary events: jetbrains.buildServer.serverSide.BuildServerListener#buildTypeAddedToQueue(jetbrains.buildServer.serverSide.SQueuedBuild) or jetbrains.buildServer.serverSide.BuildServerListener#buildTypeAddedToQueue(jetbrains.buildServer.serverSide.SBuildType)

0
Comment actions Permalink

Thanks, Sergey. I will try to make my own plugin. One question: I already did some triggers for INSERT and DELETE at TeamCity db build_queue table. I got hundred of thousands of such events in total and it's just for one day! But my build queue is not processing so much configs. Are there the same amounts of server events?

0
Comment actions Permalink

The thing is that when build queue order changes, TC deletes and inserts entries. That's why you are getting so much triggerred events. The event I mentioned above occurs once per queued build, regardless of build queue changes.

0
Comment actions Permalink

Yeah I've had the idea about TC is inserting/deleting while queue is reordering. Why not updating?

0
Comment actions Permalink

That's a legacy/design.

0

Please sign in to leave a comment.