GithubHelp home page GithubHelp logo

paultaykalo / xcode-build-times-rendering Goto Github PK

View Code? Open in Web Editor NEW
333.0 3.0 21.0 71 KB

Xcode build times visualization per target

License: MIT License

JavaScript 70.33% CSS 1.82% HTML 1.49% Ruby 26.37%

xcode-build-times-rendering's Introduction

xcode-build-times-rendering

Xcode build times visualization per target image

Installation

[sudo] gem install xcode-build-times

Injection in your project

In order to gather target build times, run the following command. This will add script build phases named "Timing START" and "Timing END" for EACH target in EACH project at specified path.

xcode-build-times install ~/Projects/<My_slowly_building_project>/

image

Events file

Once you've run the install command above, all build events will be saved to ~/.timings.xcode file every time you build your project.
NOTE: You can override this default setting by passing --events-file parameter on installation script

...
{"date":"2018-09-19T22:52:04.1537386724", "taskName":"A", "event":"start"},
{"date":"2018-09-19T22:53:01.1537386781", "taskName":"A", "event":"end"},
{"date":"2018-09-19T22:53:04.1537386784", "taskName":"B", "event":"start"},
{"date":"2018-09-19T22:55:53.1537386953", "taskName":"V", "event":"end"},
...

Generating Visualization Events

Once desired build is done, it's time to dump raw events in place we need in order to render them. This can be done by running:

xcode-build-times generate [--events-file <path>]

NOTE: You can use a different timings file by passing --events-file parameter

Open gantt.html

It's time to see results. Just open xcode-build-times-chart/gantt.html.

Uninstallation

Once you are done benchmarking your project and want to remove the "Timing START' / "Timing END" build phases from your projects, just run:

xcode-build-times uninstall ~/Projects/<My_slowly_building_project>/

(You can also delete your events file and the xcode-build-times-chart/ containing your reports)


Libraries and Kudos

d3js - JavaScript library for manipulating documents based on data
xcodeproj - Create and modify Xcode projects from Ruby.
d3js-gantt - Gantt chart for d3js by @dk8996

P.S.

If something doesn't work - please fix it

xcode-build-times-rendering's People

Contributors

inamiy avatar paultaykalo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

xcode-build-times-rendering's Issues

Target names in graph are truncated

Hello again!

I've noticed that when the name of the targets gets a bit long, since the Y axis is too far left, the labels of the target names on that axis are truncated.

Is there a way to fix that?

Even if it's just by tweaking manually the generated JS or whatnot manually for now, I'd be interested for you to point me out where to change that in the JS (I have no experience with d3js), and starting from that I could make a PR (to either try to compute the proper value based on the max width of all target names, or provide a parameter to the CLI to allow to adjust it)

Thanks!

File Copy doesn't work with Ruby 3

/Users/mobile/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/xcode-build-times-0.1.1/lib/xcode-build-times.rb:107:in generate_events_js': uninitialized constant XcodeBuildTimer::FileUtils (NameError) FileUtils.copy_entry(source_dir, File.expand_path(js_chart_directory)) Did you mean? FileTest /Users/mobile/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/xcode-build-times-0.1.1/bin/xcode-build-times:33:in <top (required)>'
Users/mobile/.rbenv/versions/3.1.2/bin/xcode-build-times:25:in load' /Users/mobile/.rbenv/versions/3.1.2/bin/xcode-build-times:25:in

'
Error: Process completed with exit code 1.

X Axis max value too big

Hello!

I've just generated a graph with your awesome tool, it looks great and is very informative to benchmark my build times!

But the X-axis in the generated graph goes from 00:00 to 10:00 despite my build time being 132s (2:12)

Is there a way to make the X-axis only go from 00:00 to 03:00 for example to avoid all that blank and empty area I get in the generated graph? (that could help reduce the effect of #8 too btw since we'd have more horizontal space to render the graph)

What parameter, or math formula computing that value, can I tweak in the generated JS to help with that?

Thanks!

generate run error

when running generate I get the following error:

$ xcode-build-times generate
[CHART] Will copy chart to /Users/-deleted-details-
/Library/Ruby/Gems/2.3.0/gems/xcode-build-times-0.1.1/lib/xcode-build-times.rb:107:in `generate_events_js': uninitialized constant XcodeBuildTimer::FileUtils (NameError)
Did you mean?  FileTest
	from /Library/Ruby/Gems/2.3.0/gems/xcode-build-times-0.1.1/bin/xcode-build-times:33:in `<top (required)>'
	from /usr/local/bin/xcode-build-times:22:in `load'
	from /usr/local/bin/xcode-build-times:22:in `<main>'

Feature Request: Configure colour by module name

Firstly, really big fan of the tool. Thank you.

Feature request:

I'd like to request a way of configuring specific colours for specific modules based on module name, such that visualisations are more deterministic between runs. Mainly for the purpose of better visualising the build information that might lead to more insights.

At the moment, the colours seem random and seem to distract from reading the data.

Use Cases:

  • All modules grey except a specific module which is Red. Helping me visualise the significant before and after of a single module.
  • All "*Domain" modules are Green, all "*Data" Modules are Red, "*Feature" modules are Blue, all "*Tests" modules are Yellow, and everything else is grey. Helping me see any outliers of a specific kind. "Oh FooDomain is longer than all the other Green ones combined"

I'm open to suggestions for how to configure this. I imagine an command line argument, or perhaps a JSON/YAML config file.

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.