Once you have the information you can start to track and trend how long each TFS build definition takes at each part of the build. Once you have that piece of data you can start to determine where the best place to optimize to further reduce build times.
The sample code below looks up the LKG build based off the build Definition. The LKG (Last Known Good) build will be set based on the last build for that build definition that passed/succeeded. It will do a simple output of the activity name and the time it took to complete. You can take this data along with the buildDetail and create a gantt chart that shows time for each step.
The build may be old (aka not a current LKG) depending on how your system works. But I found it is the best place to start. It might be useful for some teams to import all build (success and fail) so you can determine if there is a trend area of where things are failing.
Usings and references
using Microsoft.TeamFoundation.Build.Client; using Microsoft.TeamFoundation.Client;logic
Uri tfsCollectionURL = new Uri("http://TFSSERVER:8080/tfs/TFSTPC");
string tfsProjectName = "TFSPROJECTNAME";
string buildDefName = "BUILDDEFINITIONNAME";
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(tfsCollectionURL);
IBuildServer buildServer = (IBuildServer)tfs.GetService(typeof(IBuildServer));
var _buildDefinitions = buildServer.QueryBuildDefinitions(tfsProjectName);
foreach (var buildDefinition in _buildDefinitions)
{
if (buildDefinition.LastGoodBuildUri == null)
continue;
var build = buildServer.GetBuild(buildDefinition.LastGoodBuildUri);
IBuildDetail buildDetail = buildServer.GetAllBuildDetails(build.Uri);
var activityTrackingNodes = InformationNodeConverters.GetActivityTrackingNodes(buildDetail);
foreach (var activity in activityTrackingNodes)
{
if (activity.State != "Canceled" && (activity.Node.Children.Nodes.Count() == 0 || (activity.Node.Children.Nodes.Any(x => x.Type == "BuildMessage") && activity.DisplayName != "Sequence")))
{
if (activity.FinishTime.ToString() == "1/1/0001 12:00:00 AM")
continue;
Console.WriteLine(activity.DisplayName + ":" + (activity.FinishTime - activity.StartTime));
}
}
}
This comment has been removed by the author.
ReplyDeleteWow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
ReplyDeleterpa training in chennai | rpa training in chennai
rpa training in pune | rpa online training | rpa training in bangalore
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.
ReplyDeleteData Science Training in Chennai | Data Science course in anna nagar
Data Science course in chennai | Data science course in Bangalore
Data Science course in marathahalli | Data Science course in btm
All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, I would like to suggest your blog in my dude circle, so keep on updates.
ReplyDeletejava training in chennai | java training in bangalore
java training in tambaram | java training in velachery
Thank you for allowing me to read it, welcome to the next in a recent article. And thanks for sharing the nice article, keep posting or updating news article.
ReplyDeletepython training Course in chennai | python training in Bangalore | Python training institute in kalyan nagar
Wonderful bloggers like yourself who would positively reply encouraged me to be more open and engaging in commenting.So know it's helpful.
ReplyDeleteJava training in Chennai | Java training in Annanagar
Java training in Chennai | Java training institute in Chennai | Java course in Chennai
Java training in Chennai | Java training institute in Chennai | Java course in Chennai
Java training in Bangalore | Java training in Electronic city
Thank you for taking the time and sharing this information with us. It was indeed very helpful and insightful while being straight forward and to the point.
ReplyDeleteData Science course in kalyan nagar | Data Science Course in Bangalore
Data Science course in OMR | Data Science Course in Chennai
Data Science course in chennai | Best Data Science training in chennai
Data science course in velachery | Data Science course in Chennai
Data science course in jaya nagar | Data Science course in Bangalore
Data Science interview questions and answers
I would like to thank you for your nicely written post, its informative and your writing style encouraged me to read it till end. Thanks
ReplyDeleteangularjs Training in bangalore
angularjs Training in bangalore
angularjs Training in chennai
automation anywhere online Training
angularjs interview questions and answers
Really nice experience you have. Thank you for sharing. It will surely be an experience to someone.
ReplyDeletepython interview questions and answers
python tutorials
python course institute in electronic city
Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
ReplyDeleteJava interview questions and answers
Core Java interview questions and answers| Java interview questions and answers
Java training in Chennai | Java training in Tambaram
Java training in Chennai | Java training in Velachery
hanks for your post. This is excellent information. The list of your blogs is very helpful for those who want to learn, It is amazing!!! You have been helping many application.
ReplyDeletebest selenium training in chennai | best selenium training institute in chennai selenium training in chennai | best selenium training in chennai | selenium training in Velachery | selenium training in chennai omr | quora selenium training in chennai | selenium testing course fees | java and selenium training in chennai | best selenium training institute in chennai |
Thank you for benefiting from time to focus on this kind of, I feel firmly about it and also really like comprehending far more with this particular subject matter. In case doable, when you get know-how, is it possible to thoughts modernizing your site together with far more details? It’s extremely useful to me
ReplyDeletepython interview questions and answers
python tutorials
python course institute in electronic city
Awesome article. It is so detailed and well formatted that i enjoyed reading it as well as get some new information too.
ReplyDeleteAWS Training in Bangalore
AWS training in sholinganallur
AWS training in Tambaram
AWS training in Velachery
Very interesting post! Thanks for sharing your experience suggestions.
ReplyDeleteAviation Courses in Chennai
air hostess academy in Chennai
Airport Management Training in Chennai
airport ground staff training in Chennai
Aviation Academy in Chennai
air hostess training in Chennai
airport management courses in Chennai
ground staff training in Chennai
Reading your blog left me with some useful info and this was an awesome blog.
ReplyDeleteSpoken English Classes in Chennai
IELTS Coaching in Chennai
English Speaking Classes in Mumbai
IELTS Classes in Mumbai
IELTS Coaching in Mumbai
IELTS Mumbai
Best IELTS Coaching in Mumbai
IELTS Center in Mumbai
youtubers life apk
ReplyDeleteIt looks awesome article,keep updating..thank you for providing good information...
ReplyDeleteAir Hostess Training Institute in Bangalore
bBest Aviation Academy in Bangalore
Airline and Airport Management Courses in Bangalore
Ground Staff Training in Bangalore
Airport Management Courses in Chennai
Ground Staff Training in Chennai
Air Hostess Academy in Chennai
Air Hostess Course in Mumbai
Best Aviation Academy in Chennai
Aviation Training Institutes in Bangalore
news whatsapp groups
ReplyDeleteThe author clearly explains the full view of this topic and it made me more knowledgable in this domain.
ReplyDeletesalesforce Training in Bangalore
uipath Training in Bangalore
blueprism Training in Bangalore
Really informative blog for all people. Thanks for sharing it.
ReplyDeleteSpoken English Classes in Chennai
Spoken English Course in Chennai
german classes
Best IELTS Coaching in Chennai
learn Japanese in Chennai
TOEFL Coaching Centres in Chennai
content writing course in chennai
Spoken English Classes in Anna Nagar
Spoken English Classes in Tnagar
A very nice post. Thanks for sharing such a piece of valuable information...
ReplyDeleteData Analytics with R Training in Bangalore
Hadoop training center in bangalore
AWS training in bangalore
AWS training in marathahalli
Python training in marathahalli
Hadoop training in marathahalli
Python training in bangalore
I appreciate your blog writing about that specific topics.I am following your blog post regularly to get more updates
ReplyDeletesalesforce Training in Bangalore
uipath Training in Bangalore
blueprism Training in Bangalore
I feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it.
ReplyDeleteaws Training in Bangalore
python Training in Bangalore
hadoop Training in Bangalore
angular js Training in Bangalore
bigdata analytics Training in Bangalore
very nice blogger.......................!!!
ReplyDeleteinplant training in chennai
inplant training in chennai
inplant training in chennai for it
panama web hosting
syria hosting
services hosting
afghanistan shared web hosting
andorra web hosting
belarus web hosting
brunei darussalam hosting
super post...!
ReplyDeleteinternship in chennai for ece students
internships in chennai for cse students 2019
Inplant training in chennai
internship for eee students
free internship in chennai
eee internship in chennai
internship for ece students in chennai
inplant training in bangalore for cse
inplant training in bangalore
ccna training in chennai
ReplyDeleteAwesome post with lots of data and I have bookmarked this page for my reference. Share more ideas frequently.
AWS training in chennai | AWS training in anna nagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery
Amazing information has been shared.keep blogging.
ReplyDeleteJava training in Chennai
Java training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Online Training
I am looking for and I love to post a comment that "The content of your post is awesome" Great work!
ReplyDeleteangular js training in chennai
angular js training in tambaram
full stack training in chennai
full stack training in tambaram
php training in chennai
php training in tambaram
photoshop training in chennai
photoshop training in tambaram
This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information&its very useful to me..
ReplyDeleteoracle training in chennai
oracle training in velachery
oracle dba training in chennai
oracle dba training in velachery
ccna training in chennai
ccna training in velachery
seo training in chennai
seo training in velachery
I think this is one of the most significant information for me. And i’m glad reading your article. Thanks for sharing!
ReplyDeleteoracle training in chennai
oracle training in annanagar
oracle dba training in chennai
oracle dba training in annanagar
ccna training in chennai
ccna training in annanagar
seo training in chennai
seo training in annanagar
Wonderful bloggers like yourself who would positively reply encouraged me to be more open and engaging in commenting.So know it's helpful.
ReplyDeletehadoop training in chennai
hadoop training in omr
salesforce training in chennai
salesforce training in omr
c and c plus plus course in chennai
c and c plus plus course in omr
machine learning training in chennai
machine learning training in omr
Thanks for sharing your innovative blog, it's more interesting.
ReplyDeleteandroid app development future scope
what is webdriver in selenium
php programming languages
scope of ethical hacking
aws devops interview questions and answers
A very useful content!
ReplyDeleteThanks for sharing a very informative article.
data science training in chennai
ccna training in chennai
iot training in chennai
cyber security training in chennai
ethical hacking training in chennai
Great information. The above content is very interesting to read. This will be loved by all age groups.
ReplyDeletewhich cloud computing certification is best
robotic process automation scope
best digital marketing certification
free hacking books
hadoop interview questions and answers for experienced
nodejs interview questions and answers
Mua vé tại đại lý vé máy bay Aivivu, tham khảo
ReplyDeletevé máy bay từ hàn về Việt Nam
vé máy bay vinh hcm
vé máy bay đi hà nội tháng 5
vé máy bay đà nẵng nha trang Pacific airlines
ve may bay gia re di Hue
thuê xe 7 chỗ đi sân bay nội bài
Excellent blog, very informative. Thanks for sharing, I am looking forward to see more posts like this.
ReplyDeleteAlso checkout Nulls Clash.
Exceptionally pleasant post here and a debt of gratitude is in order for it .I generally like and a super substance of these post. Excellent and extremely cool thought…
ReplyDeleteData Science Training in Hyderabad