hitimes 1.2.3-java → 1.2.4-java

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
  SHA1:
3
- metadata.gz: e88c13d5ede9b4ff83db2278d377572cc527be34
4
- data.tar.gz: 700bc9d2e3a08c80eeeec494a6143e7a5b9c40cc
3
+ metadata.gz: 87e16204904848118ef0d83ebdd7feb249019a8d
4
+ data.tar.gz: 04fa2c5fb0d1720f18a89bd9db608d4a15361589
5
5
  SHA512:
6
- metadata.gz: 0aab8572f5cb56e331b15881d12fc29b39102c145801f5cd435995a62a645e3d89f82ff0d7be5873f4dac6021ee5dc6dccc03c5149b7a43dc6605091a4dc7424
7
- data.tar.gz: 27f55ad2f013631ee64dd73d2f33e7ecde22b3e3abdf8e116f126fb07ee735678bd8ab3f0f27d8f3feab374e66c60b9c774a0329bb0d3036235c26490fa91fd5
6
+ metadata.gz: 3cb35c4a52a9c5b9152cece382b92f80f064976bc1552a1274d7713942ca94c80cf7163bede989efc32e568a935fc7d6b89dec143242edbbeec1a4469f06c8c0
7
+ data.tar.gz: b97175a071b47b5f12af5925342f4f1200d545363e417fcd587d40e31ad771fdcf68ba8c1ca506bbf8151393c6a38f0d8c93b94dcd290c7466adb2b491756bb0
data/CONTRIBUTING.md CHANGED
@@ -27,15 +27,27 @@ easiest way to contribute.
27
27
  * Fork the [repo][].
28
28
  * Create a new branch for your issue: `git checkout -b issue/my-issue`
29
29
  * Lovingly craft your contribution:
30
- * `rake develop` to get started, or if you prefer bundler `rake develop:using_bunder && bundle`.
30
+ * `rake develop` to get started
31
31
  * `rake test` to run tests
32
32
  * Make sure that `rake test` passes. Its important, I said it twice.
33
33
  * Add yourself to the contributors section below.
34
34
  * Submit your [pull request][].
35
35
 
36
+ ## Building Windows Binaries
37
+
38
+ This is done using https://github.com/rake-compiler/rake-compiler-dock
39
+
40
+ 1. have VirtualBox installed
41
+ 2. have Docker Machine installed (https://docs.docker.com/engine/installation/)
42
+ 3. `gem install rake-compiler-dock`
43
+ 4. `rake-compiler-dock` (this could take a while)
44
+ 5. `bundle`
45
+ 6. `rake cross native gem`
46
+
36
47
  # Contributors
37
48
 
38
49
  * Jeremy Hinegardner
50
+ * Wojciech Piekutowski
39
51
 
40
52
  [GitHub Account]: https://github.com/signup/free "GitHub Signup"
41
53
  [GitHub Issues]: https://github.com/copiousfreetime/hitimes/issues "Hitimes Issues"
data/HISTORY.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Hitimes Changelog
2
2
 
3
+ ## Version 1.2.4 2016-05-01
4
+
5
+ * Fix finding the extension on ruby 2.1.10 (thanks @wpiekutowski)
6
+ * Add more readable load error (thanks @mbautin)
7
+ * Update README with what versions of ruby are supported.
8
+
3
9
  ## Version 1.2.3 2015-09-13
4
10
 
5
11
  * Release new fatbinary version for windows
data/README.md CHANGED
@@ -1,39 +1,52 @@
1
- ## hitimes
1
+ # Hitimes
2
+
3
+ A fast, high resolution timer library for recording peformance metrics.
2
4
 
3
5
  * [Homepage](http://github.com/copiousfreetime/hitimes)
4
6
  * [Github project](http://github.com.org/copiousfreetime/hitimes)
5
7
  * email jeremy at copiousfreetime dot org
6
8
  * `git clone url git://github.com/copiousfreetime/hitimes.git`
7
9
 
8
- ## INSTALL
10
+ ## Table of Contents
9
11
 
10
- * `gem install hitimes`
12
+ * [Requirements](#requirements)
13
+ * [Usage](#usage)
14
+ * [Contributing](#contributing)
15
+ * [Support](#support)
16
+ * [License](#license)
11
17
 
12
- ## DESCRIPTION
18
+ ## Requirements
13
19
 
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.
20
+ Hitimes requires the following to run:
17
21
 
18
- It currently supports any of the following systems:
22
+ * Ruby
19
23
 
20
- * any system with the POSIX call `clock_gettime()`
21
- * Mac OS X
22
- * Windows
23
- * JRuby
24
+ ## Usage
25
+
26
+ Hitimes easiest to use when installed with `rubygems`:
27
+
28
+ ```sh
29
+ gem install hitimes
30
+ ```
31
+
32
+ Or as part of your bundler `Gemfile`:
33
+
34
+ ```ruby
35
+ gem 'hitimes'
36
+ ```
24
37
 
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`.
38
+ You can load it with the standard ruby require statement.
28
39
 
29
- ## SYNOPSIS
40
+ ```ruby
41
+ require 'hitimes'
42
+ ```
30
43
 
31
44
  ### Interval
32
45
 
33
- Use Hitimes::Interval to calculate only the duration of a block of code. Returns
34
- the time as seconds.
46
+ Use `Hitimes::Interval` to calculate only the duration of a block of code.
47
+ Returns the time as seconds.
35
48
 
36
- ``` ruby
49
+ ```ruby
37
50
  duration = Hitimes::Interval.measure do
38
51
  1_000_000.times do |x|
39
52
  2 + 2
@@ -45,15 +58,15 @@ puts duration # => 0.047414297 (seconds)
45
58
 
46
59
  ### TimedMetric
47
60
 
48
- Use a Hitimes::TimedMetric to calculate statistics about an iterative operation
61
+ Use a `Hitimes::TimedMetric` to calculate statistics about an iterative operation
49
62
 
50
- ``` ruby
63
+ ```ruby
51
64
  timed_metric = Hitimes::TimedMetric.new('operation on items')
52
65
  ```
53
66
 
54
67
  Explicitly use `start` and `stop`:
55
68
 
56
- ``` ruby
69
+ ```ruby
57
70
  collection.each do |item|
58
71
  timed_metric.start
59
72
  # .. do something with item
@@ -61,26 +74,26 @@ collection.each do |item|
61
74
  end
62
75
  ```
63
76
 
64
- Or use the block. In TimedMetric the return value of +measure+ is the return
65
- value of the block
77
+ Or use the block. In `TimedMetric` the return value of `measure` is the return
78
+ value of the block.
66
79
 
67
- ``` ruby
80
+ ```ruby
68
81
  collection.each do |item|
69
82
  result_of_do_something = timed_metric.measure { do_something( item ) }
70
83
  end
71
84
  ```
72
85
  And then look at the stats
73
86
 
74
- ``` ruby
87
+ ```ruby
75
88
  puts timed_metric.mean
76
89
  puts timed_metric.max
77
90
  puts timed_metric.min
78
91
  puts timed_metric.stddev
79
92
  puts timed_metric.rate
80
93
  ```
81
- ### ValueMetric
94
+ ### ValueMetric
82
95
 
83
- Use a Hitimes::ValueMetric to calculate statistics about measured samples
96
+ Use a `Hitimes::ValueMetric` to calculate statistics about measured samples.
84
97
 
85
98
  ``` ruby
86
99
  value_metric = Hitimes::ValueMetric.new( 'size of thing' )
@@ -99,7 +112,7 @@ puts value_metric.rate
99
112
 
100
113
  ### TimedValueMetric
101
114
 
102
- Use a Hitimes::TimedValueMetric to calculate statistics about batches of samples
115
+ Use a `Hitimes::TimedValueMetric` to calculate statistics about batches of samples.
103
116
 
104
117
  ``` ruby
105
118
  timed_value_metric = Hitimes::TimedValueMetric.new( 'batch times' )
@@ -123,28 +136,51 @@ puts timed_value_metric.value_stats.min
123
136
  puts timed_value_metric.value_stats.stddev
124
137
  ```
125
138
 
126
- ## CHANGES
139
+ ### Implementation details
127
140
 
128
- Read the HISTORY.md file.
141
+ Hitimes use the appropriate low-level system call for each operating system to
142
+ get the highest granularity time increment possible. Generally this is
143
+ nanosecond resolution, or whatever the hardware chip in the CPU supports.
144
+
145
+ It currently supports any of the following systems:
129
146
 
130
- ## BUILDING FOR WINDOWS
147
+ * any system with the POSIX call `clock_gettime()`
148
+ * Mac OS X
149
+ * Windows
150
+ * JRuby
131
151
 
132
- This is done using https://github.com/rake-compiler/rake-compiler-dock
152
+ ## Support
133
153
 
134
- 1. have VirtualBox installed
135
- 2. Install boot2docker `brew install boot2docker`
136
- 3. `gem install rake-compiler-dock`
137
- 4. `rake-compiler-dock`
138
- 5. `bundle`
139
- 6 `rake cross native gem`
154
+ Hitimes is supported on whatever versions of ruby are currently supported.
155
+ Hitimes also follows [semantic versioning](http://semver.org/).
140
156
 
141
- ## CREDITS
157
+ The current officially supported versions of Ruby are:
158
+
159
+ * MRI Ruby 2.2, 2.3
160
+ * JRuby 1.7.25, 9.0.5.0
161
+
162
+ Unofficially supported versions, they have been supported in the past when they
163
+ were the primary rubies around. In all likelihood they still work, but are not
164
+ supported.
165
+
166
+ * MRI Ruby - everything from 1.8.7 to 2.1
167
+ * JRuby - I think everything back to 1.4
168
+ * Rubinius
169
+
170
+ ## Contributing
171
+
172
+ Please read the [CONTRIBUTING.md](CONTRIBUTING.md)
173
+
174
+ ## Credits
142
175
 
143
176
  * [Bruce Williams](https://github.com/bruce) for suggesting the idea
144
177
 
145
- ## ISC License
178
+ ## License
179
+
180
+ Hitimes is licensed under the [ISC](https://opensource.org/licenses/ISC)
181
+ license.
146
182
 
147
- Copyright (c) 2008-2015 Jeremy Hinegardner
183
+ Copyright (c) 2008-2016 Jeremy Hinegardner
148
184
 
149
185
  Permission to use, copy, modify, and/or distribute this software for any
150
186
  purpose with or without fee is hereby granted, provided that the above
data/Rakefile CHANGED
@@ -12,6 +12,7 @@ This.ruby_gemspec do |spec|
12
12
  spec.add_development_dependency( 'rdoc' , '~> 4.2' )
13
13
  spec.add_development_dependency( 'json' , '~> 1.8' )
14
14
  spec.add_development_dependency( 'rake-compiler', '~> 0.9' )
15
+ spec.add_development_dependency( 'rake-compiler-dock', '~> 0.4' )
15
16
  spec.add_development_dependency( 'simplecov' , '~> 0.9' )
16
17
 
17
18
  spec.extensions.concat This.extension_conf_files
@@ -20,5 +20,5 @@ _
20
20
  end
21
21
 
22
22
  # put in a different location if on windows so we can have fat binaries
23
- subdir = RUBY_VERSION.gsub(/\.\d$/,'')
23
+ subdir = RUBY_VERSION.gsub(/\.\d+$/,'')
24
24
  create_makefile("hitimes/#{subdir}/hitimes")
data/lib/hitimes.rb CHANGED
@@ -31,19 +31,30 @@ require 'hitimes/version'
31
31
  # this is the method recommended by rake-compiler
32
32
 
33
33
  attempts = [
34
- "hitimes/#{RUBY_VERSION.sub(/\.\d$/,'')}/hitimes",
34
+ "hitimes/#{RUBY_VERSION.sub(/\.\d+$/,'')}/hitimes",
35
35
  "hitimes/hitimes"
36
36
  ]
37
37
  loaded = false
38
38
 
39
+ path_exceptions = []
39
40
  attempts.each do |path|
40
41
  begin
41
42
  require path
42
43
  loaded = true
43
- rescue LoadError
44
+ break
45
+ rescue LoadError => load_error
46
+ full_path = File.expand_path(path)
47
+ path_exceptions << [ full_path, load_error.message ]
44
48
  end
45
49
  end
46
- raise LoadError, "Unable to find binary extension, was hitimes installed correctly?" unless loaded
50
+
51
+ if !loaded then
52
+ msg = ["Unable to find binary extension, was hitimes installed correctly? The following paths were tried."]
53
+ path_exceptions.each do |path, message|
54
+ msg << "#{path} : #{message}"
55
+ end
56
+ raise LoadError, msg.join("\n")
57
+ end
47
58
 
48
59
  require 'hitimes/stats'
49
60
  require 'hitimes/mutexed_stats'
Binary file
@@ -4,5 +4,5 @@
4
4
  #++
5
5
 
6
6
  module Hitimes
7
- VERSION = "1.2.3"
7
+ VERSION = "1.2.4"
8
8
  end
data/tasks/default.rake CHANGED
@@ -29,7 +29,7 @@ namespace :develop do
29
29
  end
30
30
  end
31
31
  end
32
- desc "Boostrap development"
32
+ desc "Bootstrap development"
33
33
  task :develop => "develop:default"
34
34
 
35
35
  #------------------------------------------------------------------------------
data/tasks/this.rb CHANGED
@@ -180,7 +180,7 @@ class ThisProject
180
180
 
181
181
  # Internal: Return the DESCRIPTION section of the README.rdoc file
182
182
  def description_section
183
- section_of( 'README.md', 'DESCRIPTION')
183
+ section_of( 'README.md', 'Hitimes')
184
184
  end
185
185
 
186
186
  # Internal: Return the summary text from the README
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hitimes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: java
6
6
  authors:
7
7
  - Jeremy Hinegardner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-13 00:00:00.000000000 Z
11
+ date: 2016-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.9'
83
+ - !ruby/object:Gem::Dependency
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '0.4'
89
+ name: rake-compiler-dock
90
+ prerelease: false
91
+ type: :development
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.4'
83
97
  - !ruby/object:Gem::Dependency
84
98
  requirement: !ruby/object:Gem::Requirement
85
99
  requirements:
@@ -94,12 +108,7 @@ dependencies:
94
108
  - - "~>"
95
109
  - !ruby/object:Gem::Version
96
110
  version: '0.9'
97
- description: 'Hitimes is a fast, high resolution timer library for recording performance
98
- metrics. It uses the appropriate low method calls for each system to get the highest
99
- granularity time increments possible. It currently supports any of the following
100
- systems: * any system with the POSIX call `clock_gettime()` * Mac OS X * Windows
101
- * JRuby Using Hitimes can be faster than using a series of `Time.new` calls, and
102
- it will have a much higher granularity. It is definitely faster than using `Process.times`.'
111
+ description: A fast, high resolution timer library for recording peformance metrics. * (http://github.com/copiousfreetime/hitimes) * (http://github.com.org/copiousfreetime/hitimes) * email jeremy at copiousfreetime dot org * `git clone url git://github.com/copiousfreetime/hitimes.git`
103
112
  email: jeremy@copiousfreetime.org
104
113
  executables: []
105
114
  extensions: []
@@ -181,7 +190,7 @@ rubyforge_project:
181
190
  rubygems_version: 2.4.8
182
191
  signing_key:
183
192
  specification_version: 4
184
- 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.
193
+ summary: A fast, high resolution timer library for recording peformance metrics.
185
194
  test_files:
186
195
  - spec/hitimes_spec.rb
187
196
  - spec/interval_spec.rb