Getting progress estimates from REST API
I'm making a small tool using the TeamCity API and have a question regarding the estimates.
1) I have only been able to get the initially estimated time from the API. Comparing the initial estimate with the one in the web interface (that changes throughout the build process), can have a huge difference. Is it possible to get the "other" estimate somehow?
My full API call is:
/app/rest/builds?locator=state:running&fields=build(number,agent(name),id,buildTypeId,startDate,status,state,running,percentageComplete,webUrl,triggered(user(username,name)),running-info(currentStageText,percentageComplete,estimatedTotalSeconds,elapsedSeconds))
where the relevant part is:
running-info(currentStageText,percentageComplete,estimatedTotalSeconds,elapsedSeconds)
2) What is the difference between percentageComplete in build and percentageComplete in running-info? Which one should be used?
Running TeamCity 10.0.4 (build 42538)
Please sign in to leave a comment.
Hi,
1) Not really, if I'm understanding corretly, one is an estimate based on how long builds usually take and how long steps take, the other one is just calculating . You could calculate a similar value yourself by picking up build times, calculate that
2) They should be the same, as far as I can tell. As far as I can tell it's just a convenience depending on which object you are using. If you find instances with different responses, they might not be syncing instantly.