hitimes 1.2.0-x86-mswin32 → 1.2.1-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ data.tar.gz: 437b2b6461ac8ac60d8235f5e94d32fc92803bd6
4
+ metadata.gz: e75b38a8bcce1592cacb06332cbb87bd4b059ebe
5
+ SHA512:
6
+ data.tar.gz: 41d11effbd3421c521dd8ce337a8c3703276837f9e37fd30fd430ef3d794a184bc1ee81e255727c55604145b6af6784b3a539c8a2c43b409af9474f8a31eaab5
7
+ metadata.gz: 73761e25f5d511ca09c56c4d2dd23b63363cbd17b81328c91121eb7c05b892e74d881f3d8bf24cef1ceb9efbb076a454e72eae4160f42e9081c099f4fce8fe1d
@@ -1,6 +1,12 @@
1
- = Hitimes Changelog
1
+ # Hitimes Changelog
2
2
 
3
- == Version 1.2.0 2013-02-09
3
+ ## Version 1.2.1 2013-03-12
4
+
5
+ * Update dependencies
6
+ * Ruby 2.0 fixes
7
+ * Switch to Markdown, Yeah RDoc 4.0!
8
+
9
+ ## Version 1.2.0 2013-02-09
4
10
 
5
11
  * Update dependencies
6
12
  * Documentation cleanup
@@ -12,75 +18,75 @@
12
18
  * Added Hitimes.measure
13
19
  * Switch to using rake-compiler for cross compilation of gems
14
20
 
15
- == Version 1.1.1 2010-09-04
21
+ ## Version 1.1.1 2010-09-04
16
22
 
17
23
  * Remove the unnecessary dependencies that should be development dependencies
18
24
 
19
- == Version 1.1.0 2010-07-28
25
+ ## Version 1.1.0 2010-07-28
20
26
 
21
27
  * Add a pure java extension so hitimes may be used in jruby with the same API
22
28
 
23
- == Version 1.0.5 2010-07-20
29
+ ## Version 1.0.5 2010-07-20
24
30
 
25
31
  * Fix 'circular require considered harmful' warnings in 1.9.x (reported by Roger Pack)
26
32
  * Fix 'method redefined' warnings in 1.9.x (reported by Roger Pack)
27
33
 
28
- == Version 1.0.4 2009-08-01
34
+ ## Version 1.0.4 2009-08-01
29
35
 
30
36
  * Add in support for x86-mingw32 gem
31
37
  * Add version subdirectory for extension on all platforms
32
38
 
33
- == Version 1.0.3 2009-06-28
39
+ ## Version 1.0.3 2009-06-28
34
40
 
35
41
  * Fix bug with time.h on linode (reported by Roger Pack)
36
42
  * Fix potential garbage collection issue with Interval class
37
43
  * Windows gem is now a fat binary to support installing in 1.8 or 1.9 from the
38
44
  same gem
39
45
 
40
- == Version 1.0.1 2009-06-12
46
+ ## Version 1.0.1 2009-06-12
41
47
 
42
48
  * Fix examples
43
49
  * performance tuning, new Hitimes::Metric derived classes are faster than old Timer class
44
50
 
45
- == Version 1.0.0 2009-06-12
51
+ ## Version 1.0.0 2009-06-12
46
52
 
47
53
  * Major version bump with complete refactor of the metric collection API
48
54
  * 3 types of metrics now instead of just 1 Timer
49
- * Hitimes::ValueMetric
50
- * Hitimes::TimedMetric
51
- * Hitimes::TimedValueMetric
55
+ * Hitimes::ValueMetric
56
+ * Hitimes::TimedMetric
57
+ * Hitimes::TimedValueMetric
52
58
  * The ability to convert all metrics #to_hash
53
59
  * Updated documentation with examples using each metric type
54
60
 
55
- == Version 0.4.1 2009-02-19
61
+ ## Version 0.4.1 2009-02-19
56
62
 
57
63
  * change to ISC License
58
64
  * fix bug in compilation on gentoo
59
65
 
60
- == Version 0.4.0 2008-12-20
66
+ ## Version 0.4.0 2008-12-20
61
67
 
62
68
  * Added new stat 'rate'
63
69
  * Added new stat method to_hash
64
70
  * Added Hitimes::MutexedStats class for threadsafe stats collection
65
- - not needed when used in MRI 1.8.x
71
+ - not needed when used in MRI 1.8.x
66
72
  * remove stale dependency on mkrf
67
73
 
68
- == Version 0.3.0
74
+ ## Version 0.3.0
69
75
 
70
76
  * switched to extconf for building extensions
71
77
  * first release of windows binary gem
72
78
  * reverted back to normal rdoc
73
79
 
74
- == Version 0.2.1
80
+ ## Version 0.2.1
75
81
 
76
82
  * added Timer#rate method
77
83
  * switched to darkfish rdoc
78
84
 
79
- == Version 0.2.0
85
+ ## Version 0.2.0
80
86
 
81
87
  * Performance improvements
82
88
  * Added Hitimes::Stats class
83
89
 
84
- == Version 0.1.0
90
+ ## Version 0.1.0
85
91
 
86
92
  * Initial completion
@@ -1,8 +1,8 @@
1
1
  CONTRIBUTING.md
2
- HISTORY.rdoc
2
+ HISTORY.md
3
3
  LICENSE
4
4
  Manifest.txt
5
- README.rdoc
5
+ README.md
6
6
  Rakefile
7
7
  examples/benchmarks.rb
8
8
  examples/stats.rb
@@ -0,0 +1,163 @@
1
+ ## hitimes
2
+
3
+ * [Homepage](http://github.com/copiousfreetime/hitimes)
4
+ * [Github project](http://github.com.org/copiousfreetime/hitimes)
5
+ * email jeremy at copiousfreetime dot org
6
+ * `git clone url git://github.com/copiousfreetime/hitimes.git`
7
+
8
+ ## INSTALL
9
+
10
+ * `gem install hitimes`
11
+
12
+ ## DESCRIPTION
13
+
14
+ Hitimes is a fast, high resolution timer library for recording
15
+ performance metrics. It uses the appropriate low method calls for each
16
+ system to get the highest granularity time increments possible.
17
+
18
+ It currently supports any of the following systems:
19
+
20
+ * any system with the POSIX call `clock_gettime()`
21
+ * Mac OS X
22
+ * Windows
23
+ * JRuby
24
+
25
+ Using Hitimes can be faster than using a series of `Time.new` calls, and
26
+ it will have a much higher granularity. It is definitely faster than
27
+ using `Process.times`.
28
+
29
+ ## SYNOPSIS
30
+
31
+ ### Interval
32
+
33
+ Use Hitimes::Interval to calculate only the duration of a block of code
34
+
35
+ ``` ruby
36
+ duration = Hitimes::Interval.measure do
37
+ # some operation ...
38
+ end
39
+
40
+ puts duration
41
+ ```
42
+
43
+ ### TimedMetric
44
+
45
+ Use a Hitimes::TimedMetric to calculate statistics about an iterative operation
46
+
47
+ ``` ruby
48
+ timed_metric = Hitimes::TimedMetric.new('operation on items')
49
+ ```
50
+
51
+ Explicitly use `start` and `stop`:
52
+
53
+ ``` ruby
54
+ collection.each do |item|
55
+ timed_metric.start
56
+ # .. do something with item
57
+ timed_metric.stop
58
+ end
59
+ ```
60
+
61
+ Or use the block. In TimedMetric the return value of +measure+ is the return
62
+ value of the block
63
+
64
+ ``` ruby
65
+ collection.each do |item|
66
+ result_of_do_something = timed_metric.measure { do_something( item ) }
67
+ end
68
+ ```
69
+ And then look at the stats
70
+
71
+ ``` ruby
72
+ puts timed_metric.mean
73
+ puts timed_metric.max
74
+ puts timed_metric.min
75
+ puts timed_metric.stddev
76
+ puts timed_metric.rate
77
+ ```
78
+ ### ValueMetric
79
+
80
+ Use a Hitimes::ValueMetric to calculate statistics about measured samples
81
+
82
+ ``` ruby
83
+ value_metric = Hitimes::ValueMetric.new( 'size of thing' )
84
+ loop do
85
+ # ... do stuff changing sizes of 'thing'
86
+ value_metric.measure( thing.size )
87
+ # ... do other stuff that may change size of thing
88
+ end
89
+
90
+ puts value_metric.mean
91
+ puts value_metric.max
92
+ puts value_metric.min
93
+ puts value_metric.stddev
94
+ puts value_metric.rate
95
+ ```
96
+
97
+ ### TimedValueMetric
98
+
99
+ Use a Hitimes::TimedValueMetric to calculate statistics about batches of samples
100
+
101
+ ``` ruby
102
+ timed_value_metric = Hitimes::TimedValueMetric.new( 'batch times' )
103
+ loop do
104
+ batch = ... # get a batch of things
105
+ timed_value_metric.start
106
+ # .. do something with batch
107
+ timed_value_metric.stop( batch.size )
108
+ end
109
+
110
+ puts timed_value_metric.rate
111
+
112
+ puts timed_value_metric.timed_stats.mean
113
+ puts timed_value_metric.timed_stats.max
114
+ puts timed_value_metric.timed_stats.min
115
+ puts timed_value_metric.timed_stats.stddev
116
+
117
+ puts timed_value_metric.value_stats.mean
118
+ puts timed_value_metric.value_stats.max
119
+ puts timed_value_metric.value_stats.min
120
+ puts timed_value_metric.value_stats.stddev
121
+ ```
122
+
123
+ ## CHANGES
124
+
125
+ Read the HISTORY.md file.
126
+
127
+ ## BUILDING FOR WINDOWS
128
+
129
+ [rake-compiler](https://github.com/luislavena/rake-compiler) is use for building
130
+ the windows version. For me, on OSX to cross compile the process is:
131
+
132
+ ```
133
+ % gem install rake-compiler # in each rvm instance, 1.8.7, 1.9.3
134
+ % rvm use 2.0.0@hitimes
135
+ % rake-compiler cross-ruby VERSION=2.0.0-p0 # or latest
136
+ % rvm use 1.9.3@hitimes
137
+ % rake-compiler cross-ruby VERSION=1.9.3-p374 # or latest
138
+ % rvm use 1.8.7@hitimes
139
+ % rake-compiler cross-ruby VERSION=1.8.7-p371
140
+
141
+ # This only works via 1.8.7 at the current moment
142
+ % rake cross native gem RUBY_CC_VERSION=1.8.7:1.9.3:2.0.0
143
+ ```
144
+
145
+ ## CREDITS
146
+
147
+ * [Bruce Williams](https://github.com/bruce) for suggesting the idea
148
+
149
+ ## ISC License
150
+
151
+ Copyright (c) 2008-2012 Jeremy Hinegardner
152
+
153
+ Permission to use, copy, modify, and/or distribute this software for any
154
+ purpose with or without fee is hereby granted, provided that the above
155
+ copyright notice and this permission notice appear in all copies.
156
+
157
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
158
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
159
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
160
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
161
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
162
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
163
+ PERFORMANCE OF THIS SOFTWARE.
data/Rakefile CHANGED
@@ -8,10 +8,10 @@ This.homepage = "http://github.com/copiousfreetime/#{ This.name }"
8
8
 
9
9
  This.ruby_gemspec do |spec|
10
10
  spec.add_development_dependency( 'rake' , '~> 10.0.3')
11
- spec.add_development_dependency( 'rspec' , '~> 2.12.0' )
12
- spec.add_development_dependency( 'rdoc' , '~> 3.12' )
13
- spec.add_development_dependency( 'json' , '~> 1.7.6' )
14
- spec.add_development_dependency( 'rake-compiler', '~> 0.8.1' )
11
+ spec.add_development_dependency( 'rspec' , '~> 2.13.0' )
12
+ spec.add_development_dependency( 'rdoc' , '~> 4.0' )
13
+ spec.add_development_dependency( 'json' , '~> 1.7.7' )
14
+ spec.add_development_dependency( 'rake-compiler', '~> 0.8.3' )
15
15
 
16
16
  spec.extensions.concat This.extension_conf_files
17
17
  end
Binary file
Binary file
@@ -4,5 +4,5 @@
4
4
  #++
5
5
 
6
6
  module Hitimes
7
- VERSION = "1.2.0"
7
+ VERSION = "1.2.1"
8
8
  end
@@ -74,9 +74,10 @@ begin
74
74
  RDoc::Task.new do |t|
75
75
  t.markup = 'tomdoc'
76
76
  t.rdoc_dir = 'doc'
77
- t.main = 'README.rdoc'
77
+ t.main = 'README.md'
78
78
  t.title = "#{This.name} #{This.version}"
79
- t.rdoc_files.include( '*.rdoc', 'lib/**/*.rb' )
79
+ t.rdoc_files.include( FileList['*.{rdoc,md,txt}'], FileList['ext/**/*.c'],
80
+ FileList['lib/**/*.rb'] )
80
81
  end
81
82
  rescue LoadError => le
82
83
  This.task_warning( 'rdoc' )
@@ -228,6 +229,9 @@ end
228
229
  # the gemspec is also a dev artifact and should not be kept around.
229
230
  CLOBBER << This.gemspec_file.to_s
230
231
 
232
+ # .rbc files from ruby 2.0
233
+ CLOBBER << FileList["**/*.rbc"]
234
+
231
235
  # The standard gem packaging task, everyone has it.
232
236
  require 'rubygems/package_task'
233
237
  Gem::PackageTask.new( This.platform_gemspec ) do
@@ -35,4 +35,4 @@ rescue LoadError
35
35
  end
36
36
 
37
37
  CLOBBER << FileList["lib/**/*.{jar,so,bundle}"]
38
- CLOBBER << FileList["lib/#{This.name}/1.{8,9}/"]
38
+ CLOBBER << FileList["lib/#{This.name}/{1.8,1.9,2.0}/"]
@@ -54,7 +54,7 @@ class ThisProject
54
54
  #
55
55
  # Retuns the text of the section as an array of paragrphs.
56
56
  def section_of( file, section_name )
57
- re = /^=+ (.*)$/
57
+ re = /^[=#]+ (.*)$/
58
58
  sectional = project_path( file )
59
59
  parts = sectional.read.split( re )[1..-1]
60
60
  parts.map! { |p| p.strip }
@@ -137,8 +137,8 @@ class ThisProject
137
137
  spec.executables = spec.files.grep(/^bin/) { |f| File.basename(f) }
138
138
  spec.test_files = spec.files.grep(/^spec/)
139
139
 
140
- spec.extra_rdoc_files += spec.files.grep(/(txt|rdoc)$/)
141
- spec.rdoc_options = [ "--main" , 'README.rdoc',
140
+ spec.extra_rdoc_files += spec.files.grep(/(txt|rdoc|md)$/)
141
+ spec.rdoc_options = [ "--main" , 'README.md',
142
142
  "--markup", "tomdoc" ]
143
143
  end
144
144
  end
@@ -187,7 +187,7 @@ class ThisProject
187
187
 
188
188
  # Internal: Return the DESCRIPTION section of the README.rdoc file
189
189
  def description_section
190
- section_of( 'README.rdoc', 'DESCRIPTION')
190
+ section_of( 'README.md', 'DESCRIPTION')
191
191
  end
192
192
 
193
193
  # Internal: Return the summary text from the README
metadata CHANGED
@@ -1,13 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hitimes
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
5
- prerelease:
6
- segments:
7
- - 1
8
- - 2
9
- - 0
10
- version: 1.2.0
4
+ version: 1.2.1
11
5
  platform: x86-mswin32
12
6
  authors:
13
7
  - Jeremy Hinegardner
@@ -15,21 +9,15 @@ autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
11
 
18
- date: 2013-02-09 00:00:00 Z
12
+ date: 2013-03-12 00:00:00 Z
19
13
  dependencies:
20
14
  - !ruby/object:Gem::Dependency
21
15
  name: rake
22
16
  prerelease: false
23
17
  requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
18
  requirements:
26
19
  - - ~>
27
20
  - !ruby/object:Gem::Version
28
- hash: 73
29
- segments:
30
- - 10
31
- - 0
32
- - 3
33
21
  version: 10.0.3
34
22
  type: :development
35
23
  version_requirements: *id001
@@ -37,81 +25,59 @@ dependencies:
37
25
  name: rspec
38
26
  prerelease: false
39
27
  requirement: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
28
  requirements:
42
29
  - - ~>
43
30
  - !ruby/object:Gem::Version
44
- hash: 63
45
- segments:
46
- - 2
47
- - 12
48
- - 0
49
- version: 2.12.0
31
+ version: 2.13.0
50
32
  type: :development
51
33
  version_requirements: *id002
52
34
  - !ruby/object:Gem::Dependency
53
35
  name: rdoc
54
36
  prerelease: false
55
37
  requirement: &id003 !ruby/object:Gem::Requirement
56
- none: false
57
38
  requirements:
58
39
  - - ~>
59
40
  - !ruby/object:Gem::Version
60
- hash: 31
61
- segments:
62
- - 3
63
- - 12
64
- version: "3.12"
41
+ version: "4.0"
65
42
  type: :development
66
43
  version_requirements: *id003
67
44
  - !ruby/object:Gem::Dependency
68
45
  name: json
69
46
  prerelease: false
70
47
  requirement: &id004 !ruby/object:Gem::Requirement
71
- none: false
72
48
  requirements:
73
49
  - - ~>
74
50
  - !ruby/object:Gem::Version
75
- hash: 7
76
- segments:
77
- - 1
78
- - 7
79
- - 6
80
- version: 1.7.6
51
+ version: 1.7.7
81
52
  type: :development
82
53
  version_requirements: *id004
83
54
  - !ruby/object:Gem::Dependency
84
55
  name: rake-compiler
85
56
  prerelease: false
86
57
  requirement: &id005 !ruby/object:Gem::Requirement
87
- none: false
88
58
  requirements:
89
59
  - - ~>
90
60
  - !ruby/object:Gem::Version
91
- hash: 61
92
- segments:
93
- - 0
94
- - 8
95
- - 1
96
- version: 0.8.1
61
+ version: 0.8.3
97
62
  type: :development
98
63
  version_requirements: *id005
99
- description: "Hitimes is a fast, high resolution timer library for recording performance metrics. It uses the appropriate low method calls for each system to get the highest granularity time increments possible. It currently supports any of the following systems: * any system with the POSIX call <tt>clock_gettime()</tt>, * Mac OS X * Windows * JRuby Using Hitimes can be faster than using a series of +Time.new+ calls, and it will have a much higher granularity. It is definitely faster than using +Process.times+."
64
+ description: "Hitimes is a fast, high resolution timer library for recording performance metrics. It uses the appropriate low method calls for each system to get the highest granularity time increments possible. It currently supports any of the following systems: * any system with the POSIX call `clock_gettime()` * Mac OS X * Windows * JRuby Using Hitimes can be faster than using a series of `Time.new` calls, and it will have a much higher granularity. It is definitely faster than using `Process.times`."
100
65
  email: jeremy@copiousfreetime.org
101
66
  executables: []
102
67
 
103
68
  extensions: []
104
69
 
105
70
  extra_rdoc_files:
106
- - HISTORY.rdoc
71
+ - CONTRIBUTING.md
72
+ - HISTORY.md
107
73
  - Manifest.txt
108
- - README.rdoc
74
+ - README.md
109
75
  files:
110
76
  - CONTRIBUTING.md
111
- - HISTORY.rdoc
77
+ - HISTORY.md
112
78
  - LICENSE
113
79
  - Manifest.txt
114
- - README.rdoc
80
+ - README.md
115
81
  - Rakefile
116
82
  - examples/benchmarks.rb
117
83
  - examples/stats.rb
@@ -153,41 +119,35 @@ files:
153
119
  - tasks/this.rb
154
120
  - lib/hitimes/1.8/hitimes.so
155
121
  - lib/hitimes/1.9/hitimes.so
122
+ - lib/hitimes/2.0/hitimes.so
156
123
  homepage: http://github.com/copiousfreetime/hitimes
157
124
  licenses: []
158
125
 
126
+ metadata: {}
127
+
159
128
  post_install_message:
160
129
  rdoc_options:
161
130
  - --main
162
- - README.rdoc
131
+ - README.md
163
132
  - --markup
164
133
  - tomdoc
165
134
  require_paths:
166
135
  - lib
167
136
  required_ruby_version: !ruby/object:Gem::Requirement
168
- none: false
169
137
  requirements:
170
- - - ">="
138
+ - &id006
139
+ - ">="
171
140
  - !ruby/object:Gem::Version
172
- hash: 3
173
- segments:
174
- - 0
175
141
  version: "0"
176
142
  required_rubygems_version: !ruby/object:Gem::Requirement
177
- none: false
178
143
  requirements:
179
- - - ">="
180
- - !ruby/object:Gem::Version
181
- hash: 3
182
- segments:
183
- - 0
184
- version: "0"
144
+ - *id006
185
145
  requirements: []
186
146
 
187
147
  rubyforge_project:
188
- rubygems_version: 1.8.25
148
+ rubygems_version: 2.0.3
189
149
  signing_key:
190
- specification_version: 3
150
+ specification_version: 4
191
151
  summary: Hitimes is a fast, high resolution timer library for recording performance metrics. It uses the appropriate low method calls for each system to get the highest granularity time increments possible.
192
152
  test_files:
193
153
  - spec/hitimes_spec.rb
@@ -1,148 +0,0 @@
1
- == hitimes
2
-
3
- * Homepage[http://github.com/copiousfreetime/hitimes]
4
- * {Github project}[http://github.com.org/copiousfreetime/hitimes]
5
- * email jeremy at copiousfreetime dot org
6
- * `git clone url git://github.com/copiousfreetime/hitimes.git`
7
-
8
- == INSTALL
9
-
10
- * gem install hitimes
11
-
12
- == DESCRIPTION
13
-
14
- Hitimes is a fast, high resolution timer library for recording
15
- performance metrics. It uses the appropriate low method calls for each
16
- system to get the highest granularity time increments possible.
17
-
18
- It currently supports any of the following systems:
19
-
20
- * any system with the POSIX call <tt>clock_gettime()</tt>,
21
- * Mac OS X
22
- * Windows
23
- * JRuby
24
-
25
- Using Hitimes can be faster than using a series of +Time.new+ calls, and
26
- it will have a much higher granularity. It is definitely faster than
27
- using +Process.times+.
28
-
29
- == SYNOPSIS
30
-
31
- === Interval
32
-
33
- Use Hitimes::Interval to calculate only the duration of a block of code
34
-
35
- duration = Hitimes::Interval.measure do
36
- # some operation ...
37
- end
38
-
39
- puts duration
40
-
41
- === TimedMetric
42
-
43
- Use a Hitimes::TimedMetric to calculate statistics about an iterative operation
44
-
45
- timed_metric = Hitimes::TimedMetric.new('operation on items')
46
-
47
- Explicitly use +start+ and +stop+:
48
-
49
- collection.each do |item|
50
- timed_metric.start
51
- # .. do something with item
52
- timed_metric.stop
53
- end
54
-
55
- Or use the block. In TimedMetric the return value of +measure+ is the return
56
- value of the block
57
-
58
- collection.each do |item|
59
- result_of_do_something = timed_metric.measure { do_something( item ) }
60
- end
61
-
62
- And then look at the stats
63
-
64
- puts timed_metric.mean
65
- puts timed_metric.max
66
- puts timed_metric.min
67
- puts timed_metric.stddev
68
- puts timed_metric.rate
69
-
70
- === ValueMetric
71
-
72
- Use a Hitimes::ValueMetric to calculate statistics about measured samples
73
-
74
- value_metric = Hitimes::ValueMetric.new( 'size of thing' )
75
- loop do
76
- # ... do stuff changing sizes of 'thing'
77
- value_metric.measure( thing.size )
78
- # ... do other stuff that may change size of thing
79
- end
80
-
81
- puts value_metric.mean
82
- puts value_metric.max
83
- puts value_metric.min
84
- puts value_metric.stddev
85
- puts value_metric.rate
86
-
87
-
88
- === TimedValueMetric
89
-
90
- Use a Hitimes::TimedValueMetric to calculate statistics about batches of samples
91
-
92
- timed_value_metric = Hitimes::TimedValueMetric.new( 'batch times' )
93
- loop do
94
- batch = ... # get a batch of things
95
- timed_value_metric.start
96
- # .. do something with batch
97
- timed_value_metric.stop( batch.size )
98
- end
99
-
100
- puts timed_value_metric.rate
101
-
102
- puts timed_value_metric.timed_stats.mean
103
- puts timed_value_metric.timed_stats.max
104
- puts timed_value_metric.timed_stats.min
105
- puts timed_value_metric.timed_stats.stddev
106
-
107
- puts timed_value_metric.value_stats.mean
108
- puts timed_value_metric.value_stats.max
109
- puts timed_value_metric.value_stats.min
110
- puts timed_value_metric.value_stats.stddev
111
-
112
-
113
- == CHANGES
114
-
115
- Read the HISTORY file.
116
-
117
- == BUILDING FOR WINDOWS
118
-
119
- {rake-compiler}(https://github.com/luislavena/rake-compiler) is use for building
120
- the windows version. For me, on OSX to cross compile the process is:
121
-
122
- % gem install rake-compiler # in each rvm instance, 1.8.7, 1.9.3
123
- % rvm use 1.9.3@hitimes
124
- % rake-compiler cross-ruby VERSION=1.9.3-p374 # or latest
125
- % rvm use 1.8.7@hitimes
126
- % rake-compiler cross-ruby VERSION=1.8.7-p371
127
-
128
- # This only works via 1.8.7 at the current moment
129
- % rake cross native gem RUBY_CC_VERSION=1.8.7:1.9.3
130
- == CREDITS
131
-
132
- * Bruce Williams for suggesting the idea
133
-
134
- == ISC License
135
-
136
- Copyright (c) 2008-2012 Jeremy Hinegardner
137
-
138
- Permission to use, copy, modify, and/or distribute this software for any
139
- purpose with or without fee is hereby granted, provided that the above
140
- copyright notice and this permission notice appear in all copies.
141
-
142
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
143
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
144
- FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
145
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
146
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
147
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
148
- PERFORMANCE OF THIS SOFTWARE.