xcprofiler 0.2.1 → 0.2.2

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: 52fc6ad175d3fd755e9b336163380845cd1639ac
4
- data.tar.gz: da3a6a35c961ce75a65790127f695f48d627edc4
3
+ metadata.gz: bde059146e60da92079977e347ddf9d8fc2bc600
4
+ data.tar.gz: 27d2eecfd366eed584767685fffbce1de830055e
5
5
  SHA512:
6
- metadata.gz: 83f5273191750496817ebd2a71e864ace68be969e7de47a2e6baed9b5fcbc826079e9becfad4997427140178b191333c0affcf3828912986c7005eaabc5203d2
7
- data.tar.gz: 7c2654c59164c7787b65b5c2d82d96766c59de68fb2e4838002a63edd94201cd8107062a232e5fbc4ea00ec4f84e547b615a371e07237872846856b7db08a7a5
6
+ metadata.gz: 5869a5c6ca211d2653b9e59174568ca0d6651588795fac185e6265fbf69e553be36f11260576a7209d5a3c90878ed1f255cfce46bd05e545797ecd5e6cdabc0d
7
+ data.tar.gz: 161930a3f5d13e839e11dde404c0d3acbe22df7f29a81ba14e04d2a80453c49c36c5c08de7c37e9fb5bccf23b37d4e28ef50e23f15069523e6a3b809f2068c00
data/README.md CHANGED
@@ -71,6 +71,7 @@ Sample output is here
71
71
  |option|shorthand|description|
72
72
  |------|---------|-----------|
73
73
  |--limit|-l|Limit for display|
74
+ |--threshold||Threshold of time to display (ms)|
74
75
  |--show-invalids||Show invalid location results|
75
76
  |--order|-o|Sort order (default,time,file)|
76
77
 
@@ -34,7 +34,7 @@ module Xcprofiler
34
34
  private
35
35
 
36
36
  def reporters
37
- @reporters ||= [StandardOutputReporter.new(limit: options[:limit], order: options[:order])]
37
+ @reporters ||= [StandardOutputReporter.new(limit: options[:limit], threshold: options[:threshold], order: options[:order])]
38
38
  end
39
39
  end
40
40
  end
@@ -14,6 +14,7 @@ module Xcprofiler
14
14
  executions = sort_executions(executions, order)
15
15
  executions = executions.delete_if(&:invalid?) unless show_invalid_locations?
16
16
  executions = executions[0...limit] if limit
17
+ executions = executions.delete_if { |v| v.time < threshold } if threshold
17
18
  executions
18
19
  end
19
20
 
@@ -34,6 +35,10 @@ module Xcprofiler
34
35
  options[:limit]
35
36
  end
36
37
 
38
+ def threshold
39
+ options[:threshold]
40
+ end
41
+
37
42
  def show_invalid_locations?
38
43
  options[:show_invalid_locations] || false
39
44
  end
@@ -1,3 +1,3 @@
1
1
  module Xcprofiler
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/xcprofiler.rb CHANGED
@@ -23,6 +23,7 @@ module Xcprofiler
23
23
  opts.on("--[no-]show-invalids", "Show invalid location results") { |v| options.show_invalid_locations = v }
24
24
  opts.on("-o [ORDER]", [:default, :time, :file], "Sort order") { |v| options.order = v }
25
25
  opts.on("-l", "--limit [LIMIT]", Integer, "Limit for display") { |v| options.limit = v }
26
+ opts.on("--threshold [THRESHOLD]", Integer, "Threshold of time to display(ms)") { |v| options.threshold = v }
26
27
  opts.on_tail("-h", "--help", "Show this message") do
27
28
  puts opts
28
29
  exit
@@ -46,6 +47,7 @@ module Xcprofiler
46
47
  end
47
48
  profiler.reporters = [
48
49
  StandardOutputReporter.new(limit: options[:limit],
50
+ threshold: options[:threshold],
49
51
  order: order,
50
52
  show_invalid_locations: options[:show_invalid_locations])
51
53
  ]
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.1
4
+ version: 0.2.2
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-28 00:00:00.000000000 Z
11
+ date: 2017-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler