pry-auto_benching.rb 2.10.3 → 2.10.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 696bf09af2e1154b97fc3d5fef3008a88c4ef6c9f4f196a304386b0545eccec6
4
- data.tar.gz: e0dcd556fc9442e11816ba6dc170b2285f32cc222ed1ccc404653d54918c9cfc
3
+ metadata.gz: 30cdc166e3207ea2b286aac030018d099e892ec379f4a0c084683866c9492636
4
+ data.tar.gz: 32a7015790e4a3a0bdc4ffca022ffaed29bae8c35d500da92efe466e100fb734
5
5
  SHA512:
6
- metadata.gz: a85843a8588f075033a94193f279bd7a78a1cf8b0f6302f75d213fdf56ab7e7390c220829fd5456555610299e0fc42af66f7eb4420aed829cc347ce1e1249257
7
- data.tar.gz: e1a184b7d9bc7425584747f43e689557cd47bb9faa6e65d6ab23c503d24dd741625181a6299462cf0d37f5b40d320bf9ad76a12ce53ca421d474c374f9bd0696
6
+ metadata.gz: be4d9521346b19cb23d36cff445597adcd3d6b223c71ff81355eacf52b83594add0aae9244e006c24888d3f7bc044bfbf19675e28ad619c030565a9a77f06b7f
7
+ data.tar.gz: c98abd3ad960be617b3714742be3af0e4d5cc2a093051ee0a5bafa61ae2615332706f4fcda4e9cb82793be5f91e88d415cfe67ea1128b774c20112ea32122cc2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v2.10.4
4
+
5
+ * Improve documentation
6
+
3
7
  ## v2.10.3
4
8
 
5
9
  * Improve documentation
data/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  * <a href='#configuration'>Configuration (optional)</a>
5
5
  * <a href='#examples'>Examples</a>
6
6
  * <a href='#accuracy'>Accuracy</a>
7
+ * <a href='#custom-prompts'>Custom prompts</a>
7
8
  * <a href='#install'>Install</a>
8
9
  * <a href='#license'>License</a>
9
10
 
@@ -15,23 +16,32 @@ pry-auto_benching.rb automates benchmarking inside the Pry REPL.
15
16
 
16
17
  Configuration isn't required unless you want to change a default. <br>
17
18
  To change the defaults, open `~/.pryrc` and change one or more of the
18
- following options:
19
+ following:
19
20
 
20
21
  ```ruby
21
22
  Pry.configure do |config|
22
- # Start benchmarking as soon as Pry starts? default is true.
23
+ #
24
+ # Start benchmarking as soon as Pry starts?
25
+ # The default is true.
26
+ #
23
27
  config.auto_benching.enabled = false
24
28
 
29
+ #
25
30
  # The max number of previous benchmark results to store in memory,
26
31
  # for use by `auto-benching --past`. The default is 70.
32
+ #
27
33
  config.auto_benching.max_history_size = 120
28
34
 
35
+ #
29
36
  # The type of clock to use, default is Process::CLOCK_MONOTONIC.
30
37
  # See https://www.rubydoc.info/stdlib/core/Process:clock_gettime
38
+ #
31
39
  config.auto_benching.clock_type = Process::CLOCK_REALTIME
32
40
 
41
+ #
33
42
  # Configure where benchmark results will be displayed.
34
- # Valid options are:
43
+ # Accepted options are:
44
+ #
35
45
  # * prompt
36
46
  # The default, results are written to the prompt.
37
47
  #
@@ -39,21 +49,28 @@ Pry.configure do |config|
39
49
  # Results are written directly to `_pry_.output`
40
50
  #
41
51
  # * none
42
- # Results are not displayed but are still recorded and can be viewed on
43
- # demand by running 'auto-benching --past'.
52
+ # Results are not displayed but are still recorded and can be
53
+ # viewed on demand by running 'auto-benching --past'.
54
+ #
44
55
  config.auto_benching.target_display = ':prompt | :output | :none'
45
56
 
57
+ #
46
58
  # Define a Proc that decides whether or not to record or display benchmark
47
59
  # results. The default condition is 'duration >= 0.01'.
60
+ #
48
61
  config.auto_benching.display_duration_if = ->(pry, duration) { duration >= 0.02 }
49
62
 
63
+ #
50
64
  # The color to use for benchmark results when `target_display` is :prompt.
51
65
  # The default is :green.
66
+ #
52
67
  config.auto_benching.prompt_color = :red
53
68
 
69
+ #
54
70
  # A lambda that returns a string for display on `_pry_.output` (usually $stdout).
55
71
  # This lambda is used when `target_display` is equal to `:output`.
56
72
  # Default is: "pry-auto_benching.rb: %.2fs".
73
+ #
57
74
  config.auto_benching.output_string = ->(pry, duration) {
58
75
  sprintf("elapsed time: %.2fs", duration)
59
76
  }
@@ -106,7 +123,7 @@ __3.__
106
123
 
107
124
  __4.__
108
125
 
109
- Display a history of benchmark results for the current Pry session with
126
+ Display a history of benchmark results for the current Pry session by running
110
127
  `auto-benching --past`:
111
128
 
112
129
  [6] 0.5s (main)> auto-benching --past
@@ -134,14 +151,10 @@ Benchmarking `sleep 0.01` shows no overhead in the results:
134
151
  => 0
135
152
  [2] 0.01s (main)>
136
153
 
137
- But it is possible results can be reported inaccurately since the measurement
154
+ But it is possible results can be reported inaccurately since the benchmark
138
155
  includes a **very** small number of method calls to Pry internals, and it could
139
- include time spent by other Pry plugins as well. I have seen inaccuracies of
140
- 10ms (0.01) but not all the time.
141
-
142
- The overhead could be considered negligible, although other Pry plugins running
143
- before/after eval hooks and spending a lot of time doing that could skew results
144
- more than is expected.
156
+ include time spent by other Pry plugins who run before/after eval hooks as well.
157
+ I have seen inaccuracies of 10ms (0.01) but not all the time.
145
158
 
146
159
  ## <a id='custom-prompts'>Custom prompts</a>
147
160
 
@@ -1,5 +1,5 @@
1
1
  class Pry
2
2
  module AutoBenching
3
- VERSION = "2.10.3"
3
+ VERSION = "2.10.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-auto_benching.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.3
4
+ version: 2.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Gleeson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-24 00:00:00.000000000 Z
11
+ date: 2018-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry