xcprofiler 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80fcd7c27be1aca66f3737dee49efe6fbd5eb1e5
4
- data.tar.gz: dde766a09f92f390140db73f0d297359137eca50
3
+ metadata.gz: 52fc6ad175d3fd755e9b336163380845cd1639ac
4
+ data.tar.gz: da3a6a35c961ce75a65790127f695f48d627edc4
5
5
  SHA512:
6
- metadata.gz: 40694281fdc8f23f71fdcb16adcc408299770a2df619ea429898ab6ed5a28ac26ce0adab94c7f619bdbaa1055be6df746a2903e7b91ce488477ec27bb8de2ba8
7
- data.tar.gz: da8040fd25d2245e8de385866dfb2c12e410ea3af43b2dbbe29cb3aaec91b7d81bc191d82e54d4c18a93775087f0a9b2318713c7787ac8813de3752abaddc4ce
6
+ metadata.gz: 83f5273191750496817ebd2a71e864ace68be969e7de47a2e6baed9b5fcbc826079e9becfad4997427140178b191333c0affcf3828912986c7005eaabc5203d2
7
+ data.tar.gz: 7c2654c59164c7787b65b5c2d82d96766c59de68fb2e4838002a63edd94201cd8107062a232e5fbc4ea00ec4f84e547b615a371e07237872846856b7db08a7a5
data/.coveralls.yml CHANGED
@@ -1 +1 @@
1
- repo_token: 1pEOUTj3O1iV7D3cX8vNSEqgMoowKRKwW
1
+ service_name: travis-ci
data/README.md CHANGED
@@ -8,7 +8,7 @@ Command line utility to profile compilation time of Swift project.
8
8
 
9
9
  ![](https://raw.githubusercontent.com/giginet/xcprofiler/master/assets/sample_output.png)
10
10
 
11
- This tool developed in working time for Cookpad.
11
+ This tool is developed in working time for Cookpad.
12
12
 
13
13
  ## Installation
14
14
 
@@ -40,30 +40,30 @@ $ xcprofiler ~/Library/Developer/Xcode/DerivedData/MyApp-xxxxxxxxxxx/Logs/Build/
40
40
  Sample output is here
41
41
 
42
42
  ```
43
- +--------------------------------------------------+------+------------------------------------------------------------------------------------------------------------------------------------------+----------+
44
- | File | Line | Method name | Time(ms) |
45
- +--------------------------------------------------+------+------------------------------------------------------------------------------------------------------------------------------------------+----------+
46
- | Phakchi/Sources/Phakchi/Interaction.swift | 17 | get {} | 69.9 |
47
- | Phakchi/Sources/Phakchi/Matcher.swift | 7 | get {} | 68.9 |
48
- | Phakchi/Sources/Phakchi/InteractionBuilder.swift | 87 | func clean() | 49.8 |
49
- | Phakchi/Sources/Phakchi/Session.swift | 74 | public func run(completionBlock: TestCompletionBlock? = default, executionBlock: @escaping TestExecutionBlock) | 49.6 |
50
- | Phakchi/Sources/Phakchi/Session.swift | 65 | @discardableResult public func willRespondWith(status: Int, headers: Headers? = default, body: Body? = default) -> Self | 28.3 |
51
- | Phakchi/Sources/Phakchi/ControlServer.swift | 20 | public func startSession(consumerName: String, providerName: String, completion completionBlock: StartSessionCompletionBlock? = default) | 24.6 |
52
- | Phakchi/Sources/Phakchi/ControlServer.swift | 24 | (closure) | 23.9 |
53
- | Phakchi/Sources/Phakchi/InteractionBuilder.swift | 19 | private func makeHeaders(_ headers: Headers?, defaultHeaders: Headers?) -> Headers? | 20.5 |
54
- | Phakchi/Sources/Phakchi/ServiceClient.swift | 47 | func registerInteraction(_ interaction: Interaction, completionHandler: CompletionHandler? = default) | 16.4 |
55
- | Phakchi/Sources/Phakchi/ServiceClient.swift | 60 | func verify(_ completionHandler: VerificationCompletionHandler? = default) | 14.3 |
56
- | Phakchi/Sources/Phakchi/ServiceClient.swift | 27 | func resumeSessionTask(_ request: URLRequest, completionHandler: CompletionHandler? = default) | 13.3 |
57
- | Phakchi/Sources/Phakchi/ControlServer.swift | 32 | public func session(forConsumerName consumerName: String, providerName: String) -> Session? | 9.7 |
58
- | Phakchi/Sources/Phakchi/InteractionBuilder.swift | 94 | get {} | 5.9 |
59
- | Phakchi/Sources/Phakchi/ServiceClient.swift | 15 | func makePactRequest(to endpoint: String, method: HTTPMethod, headers: [String : String] = default) -> URLRequest | 5.3 |
60
- | Phakchi/Sources/Phakchi/ServiceClient.swift | 51 | func registerInteractions(_ interactions: [Interaction], completionHandler: CompletionHandler? = default) | 5.1 |
61
- | Phakchi/Sources/Phakchi/Encodable.swift | 39 | get {} | 4.8 |
62
- | Phakchi/Sources/Phakchi/ServiceClient.swift | 121 | func start(session consumerName: String, providerName: String, completionHandler: @escaping CreateSessionCompletionHandler) | 3.7 |
63
- | Phakchi/Sources/Phakchi/Encodable.swift | 29 | get {} | 3.4 |
64
- | Phakchi/Sources/Phakchi/ServiceClient.swift | 72 | func writePact(for providerName: String, consumerName: String, exportPath: URL?, completionHandler: CompletionHandler? = default) | 3.3 |
65
- | Phakchi/Sources/Phakchi/ServiceClient.swift | 125 | (closure) | 3.1 |
66
- +--------------------------------------------------+------+------------------------------------------------------------------------------------------------------------------------------------------+----------+
43
+ +----------------------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+
44
+ | File | Line | Method name | Time(ms) |
45
+ +----------------------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+
46
+ | ResultProtocol.swift | 132 | public func ==<T : ResultProtocol where T.Value : Equatable, T.Error : Equatable>(left: T, right: T) -> Bool | 14.2 |
47
+ | Result.swift | 66 | get {} | 13.1 |
48
+ | Result.swift | 78 | public static func error(_ message: String? = default, function: String = #function, file: String = #file, line: Int = #line) -> NSError | 6.3 |
49
+ | Result.swift | 69 | get {} | 2.2 |
50
+ | Result.swift | 132 | public func `try`<T>(_ function: String = #function, file: String = #file, line: Int = #line, try: (NSErrorPointer) -> T?) -> Result<T, NSError> | 1.7 |
51
+ | Result.swift | 95 | get {} | 1.4 |
52
+ | Result.swift | 21 | public init(_ value: T?, failWith: @autoclosure () -> Error) | 0.9 |
53
+ | Result.swift | 142 | public func `try`(_ function: String = #function, file: String = #file, line: Int = #line, try: (NSErrorPointer) -> Bool) -> Result<(), NSError> | 0.9 |
54
+ | ResultProtocol.swift | 172 | @available(*, unavailable, renamed: "recover(with:)") public func recoverWith(_ result: @autoclosure () -> Self) -> Self | 0.7 |
55
+ | Result.swift | 72 | get {} | 0.6 |
56
+ | Result.swift | 75 | get {} | 0.6 |
57
+ | ResultProtocol.swift | 72 | public func recover(_ value: @autoclosure () -> Value) -> Value | 0.5 |
58
+ | ResultProtocol.swift | 111 | public func &&&<L : ResultProtocol, R : ResultProtocol where L.Error == R.Error>(left: L, right: @autoclosure () -> R) -> Result<(L.Value, R.Value), L.Error> | 0.5 |
59
+ | ResultProtocol.swift | 144 | public func !=<T : ResultProtocol where T.Value : Equatable, T.Error : Equatable>(left: T, right: T) -> Bool | 0.5 |
60
+ | ResultProtocol.swift | 92 | public func tryMap<U>(_ transform: (Value) throws -> U) -> Result<U, Error> | 0.4 |
61
+ | Result.swift | 175 | @available(*, unavailable, renamed: "success") public static func Success(_: T) -> Result<T, Error> | 0.3 |
62
+ | ResultProtocol.swift | 55 | public func mapError<Error2>(_ transform: (Error) -> Error2) -> Result<Value, Error2> | 0.3 |
63
+ | ResultProtocol.swift | 77 | public func recover(with result: @autoclosure () -> Self) -> Self | 0.3 |
64
+ | ResultProtocol.swift | 93 | (closure) | 0.3 |
65
+ | Result.swift | 31 | public init(attempt f: () throws -> T) | 0.2 |
66
+ +----------------------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+
67
67
  ```
68
68
 
69
69
  ### Available Options
Binary file
@@ -26,8 +26,8 @@ module Xcprofiler
26
26
  end
27
27
 
28
28
  reporters.each do |reporter|
29
- reporter = reporter
30
- reporter.report!(derived_data.executions)
29
+ filtered = reporter.filter_executions(derived_data.executions)
30
+ reporter.report!(filtered)
31
31
  end
32
32
  end
33
33
 
@@ -10,8 +10,6 @@ module Xcprofiler
10
10
  raise NotImplementedError, 'Not implemented'
11
11
  end
12
12
 
13
- protected
14
-
15
13
  def filter_executions(executions)
16
14
  executions = sort_executions(executions, order)
17
15
  executions = executions.delete_if(&:invalid?) unless show_invalid_locations?
@@ -19,6 +17,8 @@ module Xcprofiler
19
17
  executions
20
18
  end
21
19
 
20
+ protected
21
+
22
22
  def sort_executions(executions, order)
23
23
  case order
24
24
  when :default
@@ -3,7 +3,7 @@ require 'json'
3
3
  module Xcprofiler
4
4
  class JSONReporter < AbstractReporter
5
5
  def report!(executions)
6
- json = filter_executions(executions).map(&:to_h)
6
+ json = executions.map(&:to_h)
7
7
  unless output_path
8
8
  raise OutputPathIsNotSpecified, '[JSONReporter] output_path is not specified'
9
9
  end
@@ -3,16 +3,17 @@ require 'terminal-table'
3
3
  module Xcprofiler
4
4
  class StandardOutputReporter < AbstractReporter
5
5
  def report!(executions)
6
- filtered = filter_executions(executions)
7
- puts table_for(filtered)
6
+ puts table_for(executions)
8
7
  end
9
8
 
9
+ private
10
+
10
11
  def table_for(executions)
11
12
  Terminal::Table.new do |t|
12
13
  t << ['File', 'Line', 'Method name', 'Time(ms)']
13
14
  t << :separator
14
15
  executions.each do |execution|
15
- t << [execution.path, execution.line, execution.method_name, execution.time]
16
+ t << [execution.filename, execution.line, execution.method_name, execution.time]
16
17
  end
17
18
  end
18
19
  end
@@ -1,3 +1,3 @@
1
1
  module Xcprofiler
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcprofiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - giginet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-26 00:00:00.000000000 Z
11
+ date: 2016-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler