Is there any optimized way to find the different failure counts in TeamCity?

Hi,

Can anybody give an optimized solution to find the different failure counts in TeamCity?

I searched the forum and find two solutions.(but both are not direct ones, but have to give some process logics)

1) processEntries
2) getEntriesSince method of BuildHistory service.

From the forum itself it is known that processEntries is not so good in performance wise.

and

getEntriesSince(@Nullable SBuild sinceBuildInclusive,@NotNull BuildType buildType)

Returns builds of the specified configuration started after the
specified build (including the specified build), ordered by changes.
History builds which contain changes older than in sinceBuildInclusive
are not included.

I want to find the different failures in a particular date range. So
getEntriesSince method will not be helpful in this scenario.

I can do this by the traversal of all builds and buildhistory. But it is very slow.

Can anybody have idea how to get it so that I can avid the traversal of all builds and buildhistory?

thanks in advance.

3 comments
Comment actions Permalink

Both processEntries and getEntriesSince/getEntriesBefore  seems to be OK for the task.
You will probably be not very interested in history/out-of-changes-sequence builds, so if you need to traverse several build configurations only, getEntriesSince looks fine.
If you are not limited to several build configurations, processEntries is the way to go.

Of course, if you need to traverse many builds frequently there will be a performance impact. You can try to arrange your logic not to proces same builds many times.


BTW, can you describe what type of plugin do you write?

0
Comment actions Permalink

thank you for the quick reply.

We are developing a server side plugin which will report about all types of failures like build failures, compilation failures, test failures etc from TeamCity build configurations.
And these data need to be within the date range that is given by us.

As per my understanding getEntriesSince method


Returns builds of the specified configuration started after the
specified build (including the specified build), ordered by changes.

So I suppose it cannot have the build failures within this particular daterange only.
Am I correct?

I think
getEntriesSince(java.util.Date sinceDate, BuildType buildType)

will serve our purpose. But it is marked deprecated in the latest version of TeamCity.
So is there any equivalent API where I can pass the date parameters?

thank you

0
Comment actions Permalink

Hello,

Sorry for the delay in replying.

Yes,  getEntriesSince(java.util.Date sinceDate, BuildType buildType)
seems to be appropriate for your case. It is marked as depricated, but it can still remain for some time.

Alternative approach would be to use BuildHistory.processEntries
This allows to process builds one by one and stop processing when all builds have been found.
Since the builds are fed from most recent to oldest, you can check if the build is included into the data range and process it and then if the build is before the starting date of the range, just return false from processor to stop further processing.

0

Please sign in to leave a comment.