Giter VIP home page Giter VIP logo

buildtimes's Introduction

Monitor Xcode Build Times

This repo contains a script that helps you to monitor your Xcode build times across multiple days and perform analysis on them. Especially if you work full time at a large codebase you may feel like builds only increase in time. It is easy to perform a clean build and measure performance that way, but most often you'll do incremental builds. In order to measure trends here we need more data, and that's what we're trying to collect here.

Setup

To get started clone this repo locally and compile the Swift script in terminal as follows:

$ swiftc BuildTimes.swift

Once you have done that you'll need to modify the paths within the .sh files. By default I'm using the Developer directory within your home folder. However you may choose a different path:

#!/bin/bash
~/Developer/BuildTimes/BuildTimes -start

Note: By default the script will store the generated data within your Documents directory. This makes it easily accessible and can be the same across all machines. However if you prefere to store the generated .json somewhere else you can go into the BuildTimes.swift script and modify the func fileURL() helper function.

Finally you need to go into the Xcode behavior settings and select the scripts to run for the corresponding trigger. I choose the endBuild.sh script to run for both Succeeds and the Fails behavior. Starts Build Behavior Succeeds Build Behavior

Usage

Once you're done with the setup, it is suggested you do a build and check your Documents directory that the output file is created without issues. If you do not see a file show up after building, double check that the path you entered was correct. You can also try to trigger the Starts behavior manually by calling: ./BuildTimes -start,

Once you have collected some data, you can ask the script to print out daily stats:

$ ./BuildTimes -list

This will then output data in the following format:

Aug 17, 2020: 	 Total Build Time: 45m 23s 	 Average Build Time: 1m 12s
Aug 18, 2020: 	 Total Build Time: 37m 43s 	 Average Build Time: 59s
Aug 19, 2020: 	 Total Build Time: 28m 32s 	 Average Build Time: 45s
Aug 20, 2020: 	 Total Build Time: 42m 54s 	 Average Build Time: 1m 2s
Aug 21, 2020:	 Total Build Time: 33m 6s	 Average Build Time: 52s

Data Format

The data is provided to you in a JSON format. By default it can be found in your Documents directory. This allows you to do more processing with the collected data.

The data model looks as follows:

date: String
lastStart: Date
totalBuildTime: TimeInterval
totalBuilds: Int

Here is an example of what the JSON format looks like:

[
	{
		"date" : "Aug 24, 2020"
		"lastStart" : 620021178.24967599,
		"totalBuildTime" : 1542.219682931900024,
		"totalBuilds" : 21,
	},
	{
		"date" : "Aug 25, 2020"
		"lastStart" : 620112168.20791101,
		"totalBuildTime" : 104.5191808938980103,
		"totalBuilds" : 2,
	}
]

buildtimes's People

Contributors

timroesner avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.