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 CHANGED
@@ -1,4 +1,9 @@
1
1
  = Changelog
2
+ == Version 0.4.1 2009-02-19
3
+
4
+ * change to ISC License
5
+ * fix bug in compilation on gentoo
6
+
2
7
  == Version 0.4.0 2008-12-20
3
8
 
4
9
  * Added new stat 'rate'
data/LICENSE CHANGED
@@ -1,19 +1,13 @@
1
1
  Copyright (c) 2008 Jeremy Hinegardner
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of
4
- this software and associated documentation files (the "Software"), to deal in
5
- the Software without restriction, including without limitation the rights to
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
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
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
- == MIT LICENSE
60
+ == ISC License
61
61
 
62
62
  Copyright (c) 2008 Jeremy Hinegardner
63
63
 
64
- Permission is hereby granted, free of charge, to any person obtaining a copy of
65
- this software and associated documentation files (the "Software"), to deal in
66
- the Software without restriction, including without limitation the rights to
67
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
68
- of the Software, and to permit persons to whom the Software is furnished to do
69
- so, subject to the following conditions:
70
-
71
- The above copyright notice and this permission notice shall be included in all
72
- copies or substantial portions of the Software.
73
-
74
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
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.
@@ -3,6 +3,11 @@
3
3
  #include "hitimes_interval.h"
4
4
 
5
5
  #include <sys/time.h>
6
+ #ifndef CLOCK_MONOTONIC
7
+ # ifdef __linux__
8
+ # include <linux/time.h>
9
+ # endif
10
+ #endif
6
11
 
7
12
  hitimes_instant_t hitimes_get_current_instant( )
8
13
  {
@@ -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 seconds ( rate ) rate stat. If no values have passed
95
- * through the stats object then 0.0 is returned.
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 _stddev_.
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
@@ -17,12 +17,11 @@ module Hitimes
17
17
  # is guaranteed.
18
18
  #
19
19
  def self.root_dir
20
- unless @root_dir
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
- end
25
- return @root_dir
24
+ )
26
25
  end
27
26
 
28
27
  #
@@ -11,15 +11,15 @@ module Hitimes
11
11
 
12
12
  MAJOR = 0
13
13
  MINOR = 4
14
- BUILD = 0
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
 
@@ -10,5 +10,4 @@ describe Hitimes::Paths do
10
10
  it "can access the lib path of the project" do
11
11
  Hitimes::Paths.lib_path.should == File.expand_path( File.join( File.dirname( __FILE__ ), "..", "lib" ) ) + ::File::SEPARATOR
12
12
  end
13
-
14
13
  end
@@ -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
 
@@ -8,9 +8,8 @@ if rdoc_config = Configuration.for_if_exist?('rdoc') then
8
8
 
9
9
  namespace :doc do
10
10
 
11
+ require 'rdoc'
11
12
  require 'rake/rdoctask'
12
- #gem 'darkfish-rdoc'
13
- #require 'darkfish-rdoc'
14
13
 
15
14
  # generating documentation locally
16
15
  Rake::RDocTask.new do |rdoc|
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.0
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: 2008-12-20 00:00:00 -07:00
12
+ date: 2009-02-19 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency