hitimes 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +5 -0
- data/LICENSE +10 -16
- data/README +12 -18
- data/ext/hitimes_instant_clock_gettime.c +5 -0
- data/ext/hitimes_stats.c +6 -3
- data/lib/hitimes/mutexed_stats.rb +5 -0
- data/lib/hitimes/paths.rb +2 -3
- data/lib/hitimes/version.rb +3 -3
- data/spec/paths_spec.rb +0 -1
- data/tasks/config.rb +2 -2
- data/tasks/documentation.rake +1 -2
- metadata +2 -2
data/HISTORY
CHANGED
data/LICENSE
CHANGED
@@ -1,19 +1,13 @@
|
|
1
1
|
Copyright (c) 2008 Jeremy Hinegardner
|
2
2
|
|
3
|
-
Permission
|
4
|
-
|
5
|
-
|
6
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
7
|
-
of the Software, and to permit persons to whom the Software is furnished to do
|
8
|
-
so, subject to the following conditions:
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
4
|
+
purpose with or without fee is hereby granted, provided that the above
|
5
|
+
copyright notice and this permission notice appear in all copies.
|
9
6
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
-
SOFTWARE.
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
9
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
data/README
CHANGED
@@ -57,24 +57,18 @@ Read the HISTORY file.
|
|
57
57
|
|
58
58
|
* Bruce Williams for suggesting the idea
|
59
59
|
|
60
|
-
==
|
60
|
+
== ISC License
|
61
61
|
|
62
62
|
Copyright (c) 2008 Jeremy Hinegardner
|
63
63
|
|
64
|
-
Permission
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
76
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
77
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
78
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
79
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
80
|
-
SOFTWARE.
|
64
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
65
|
+
purpose with or without fee is hereby granted, provided that the above
|
66
|
+
copyright notice and this permission notice appear in all copies.
|
67
|
+
|
68
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
69
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
70
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
71
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
72
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
73
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
74
|
+
PERFORMANCE OF THIS SOFTWARE.
|
data/ext/hitimes_stats.c
CHANGED
@@ -91,8 +91,11 @@ VALUE hitimes_stats_mean( VALUE self )
|
|
91
91
|
* call-seq:
|
92
92
|
* stat.rate -> Float
|
93
93
|
*
|
94
|
-
* Return the count per
|
95
|
-
*
|
94
|
+
* Return the count per sum. In many cases when Stats#update( _value_ ) is
|
95
|
+
* called, the _value_ is a unit of time, typically seconds. #rate
|
96
|
+
* is a convenience for those times. In the most common case, where _value_
|
97
|
+
* is in seconds, then #rate returns the count / second.
|
98
|
+
*
|
96
99
|
*/
|
97
100
|
VALUE hitimes_stats_rate( VALUE self )
|
98
101
|
{
|
@@ -203,7 +206,7 @@ VALUE hitimes_stats_stddev ( VALUE self )
|
|
203
206
|
* modeled after the RFuzz::Sampler class, but implemented in C. For general use
|
204
207
|
* you allocate a new Stats object, and then update it with new values. The
|
205
208
|
* Stats object will keep track of the _min_, _max_, _count_ and _sum_ and when
|
206
|
-
* you want you may also retrieve the _mean_ and
|
209
|
+
* you want you may also retrieve the _mean_, _stddev_ and _rate_.
|
207
210
|
*
|
208
211
|
* this contrived example shows getting a list of all the files in a directory
|
209
212
|
* and running stats on file sizes.
|
@@ -2,6 +2,11 @@ require 'hitimes'
|
|
2
2
|
require 'thread'
|
3
3
|
|
4
4
|
module Hitimes
|
5
|
+
#
|
6
|
+
# MutexedStats is the start of a threadsafe Stats class. Currently, on MRI
|
7
|
+
# Ruby the Stats object is already threadsafe, so there is no need to use
|
8
|
+
# MutexedStats.
|
9
|
+
#
|
5
10
|
class MutexedStats < Stats
|
6
11
|
def initialize
|
7
12
|
@mutex = Mutex.new
|
data/lib/hitimes/paths.rb
CHANGED
@@ -17,12 +17,11 @@ module Hitimes
|
|
17
17
|
# is guaranteed.
|
18
18
|
#
|
19
19
|
def self.root_dir
|
20
|
-
|
20
|
+
@root_dir ||=(
|
21
21
|
path_parts = ::File.expand_path(__FILE__).split(::File::SEPARATOR)
|
22
22
|
lib_index = path_parts.rindex("lib")
|
23
23
|
@root_dir = path_parts[0...lib_index].join(::File::SEPARATOR) + ::File::SEPARATOR
|
24
|
-
|
25
|
-
return @root_dir
|
24
|
+
)
|
26
25
|
end
|
27
26
|
|
28
27
|
#
|
data/lib/hitimes/version.rb
CHANGED
@@ -11,15 +11,15 @@ module Hitimes
|
|
11
11
|
|
12
12
|
MAJOR = 0
|
13
13
|
MINOR = 4
|
14
|
-
BUILD =
|
14
|
+
BUILD = 1
|
15
15
|
|
16
|
-
#
|
16
|
+
#
|
17
17
|
# :call-seq:
|
18
18
|
# Version.to_a -> [ MAJOR, MINOR, BUILD ]
|
19
19
|
#
|
20
20
|
# Return the version as an array of Integers
|
21
21
|
#
|
22
|
-
def to_a
|
22
|
+
def to_a
|
23
23
|
[MAJOR, MINOR, BUILD]
|
24
24
|
end
|
25
25
|
|
data/spec/paths_spec.rb
CHANGED
data/tasks/config.rb
CHANGED
@@ -62,7 +62,7 @@ Configuration.for('test') {
|
|
62
62
|
mode "spec"
|
63
63
|
files Configuration.for("packaging").files.test
|
64
64
|
options %w[ --format specdoc --color ]
|
65
|
-
ruby_opts %w[
|
65
|
+
ruby_opts %w[ ]
|
66
66
|
}
|
67
67
|
|
68
68
|
#-----------------------------------------------------------------------
|
@@ -72,7 +72,7 @@ Configuration.for('rcov') {
|
|
72
72
|
output_dir "coverage"
|
73
73
|
libs %w[ lib ]
|
74
74
|
rcov_opts %w[ --html ]
|
75
|
-
ruby_opts %w[
|
75
|
+
ruby_opts %w[ ]
|
76
76
|
test_files Configuration.for('packaging').files.test
|
77
77
|
}
|
78
78
|
|
data/tasks/documentation.rake
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hitimes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Hinegardner
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-02-19 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|