giginet / xcprofiler

:chart_with_upwards_trend: CLI to profile compilation time of Swift project
MIT License
332 stars 13 forks source link

Added the option to control the duplicated executions. #11

Closed timakin closed 7 years ago

timakin commented 7 years ago

Overview

https://github.com/giginet/xcprofiler/issues/6 Added the option --allow-duplicated and changed to remove duplicated results as default.

Usage

$ xcprofiler [project-name] --allow-duplicated

Example

$ xcprofiler spec/fixtures/MyApp-xxxxxxxxxxx/Logs/Build/valid.xcactivitylog --allow-duplicated
...
| InteractionBuilder.swift | 12   | set {}                                                                                                                                                 | 0.0      |
| InteractionBuilder.swift | 12   | set {}                                                                                                                                                 | 0.0      |
| InteractionBuilder.swift | 13   | get {}                                                                                                                                                 | 0.0      |
| InteractionBuilder.swift | 13   | set {}                                                                                                                                                 | 0.0      |
| InteractionBuilder.swift | 13   | set {}                                                                                                                                                 | 0.0      |
| InteractionBuilder.swift | 13   | set {}                                                                                                                                                 | 0.0      |
| InteractionBuilder.swift | 13   | get {}                                                                                                                                                 | 0.0      |
| InteractionBuilder.swift | 13   | get {}                                                                                                                                                 | 0.0      |
| InteractionBuilder.swift | 15   | required init()                                                                                                                                        | 0.0      |
| Matcher.swift            | 23   | get {}                                                                                                                                                 | 0.0      |
| Matcher.swift            | 34   | get {}                                                                                                                                                 | 0.0      |
| Matcher.swift            | 46   | init()                                                                                                                                                 | 0.0      |
| ServiceClient.swift      | 41   | get {}                                                                                                                                                 | 0.0      |
| ServiceClient.swift      | 41   | get {}                                                                                                                                                 | 0.0      |
| ServiceClient.swift      | 102  | get {}                                                                                                                                                 | 0.0      |
| ServiceClient.swift      | 102  | get {}                                                                                                                                                 | 0.0      |
...
$ xcprofiler spec/fixtures/MyApp-xxxxxxxxxxx/Logs/Build/valid.xcactivitylog
...
| ControlServer.swift      | 8    | get {}                                                                                                                                                 | 0.2      |
| Matcher.swift            | 55   | public static func eachLike<T>(_ value: T, min: Int = default) -> PactEncodable                                                                        | 0.2      |
| Session.swift            | 53   | @discardableResult public func uponReceiving(_ description: String) -> Self                                                                            | 0.2      |
| Interaction.swift        | 15   | set {}                                                                                                                                                 | 0.1      |
| InteractionBuilder.swift | 36   | @discardableResult func given(_ providerState: String) -> Self                                                                                         | 0.1      |
| InteractionBuilder.swift | 42   | @discardableResult func uponReceiving(_ description: String) -> Self                                                                                   | 0.1      |
| Matcher.swift            | 47   | public static func term(generate: String, matcher: String) -> PactEncodable                                                                            | 0.1      |
| Matcher.swift            | 51   | public static func like<T>(_ value: T) -> PactEncodable                                                                                                | 0.1      |
| ServiceClient.swift      | 43   | init(baseURL: URL)                                                                                                                                     | 0.1      |
| ServiceClient.swift      | 106  | init()                                                                                                                                                 | 0.1      |
| Session.swift            | 9    | final get {}                                                                                                                                           | 0.1      |
| Session.swift            | 11   | set {}                                                                                                                                                 | 0.1      |
| ControlServer.swift      | 3    | init()                                                                                                                                                 | 0.0      |
| ControlServer.swift      | 3    | @objc deinit                                                                                                                                           | 0.0      |
| ControlServer.swift      | 11   | final get {}                                                                                                                                           | 0.0      |
| InteractionBuilder.swift | 6    | @objc deinit                                                                                                                                           | 0.0      |
| InteractionBuilder.swift | 15   | required init()                                                                                                                                        | 0.0      |
| Matcher.swift            | 46   | init()                                                                                                                                                 | 0.0      |
| ServiceClient.swift      | 41   | get {}                                                                                                                                                 | 0.0      |
| Session.swift            | 3    | @objc deinit                                                                                                                                           | 0.0      |
...
giginet commented 7 years ago

Could you add the test cases when unique is false?

giginet commented 7 years ago

@timakin Thank you. I'll merge this. I think we should improve specs. I'm going to do this later.