hitimes 1.1.1-x86-mingw32 → 1.2.2-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +10 -0
- data/CONTRIBUTING.md +45 -0
- data/{HISTORY → HISTORY.md} +42 -18
- data/LICENSE +11 -8
- data/Manifest.txt +45 -0
- data/README.md +163 -0
- data/Rakefile +23 -62
- data/ext/hitimes/c/extconf.rb +24 -0
- data/ext/hitimes/{hitimes_ext.c → c/hitimes.c} +1 -1
- data/ext/hitimes/{hitimes_instant_clock_gettime.c → c/hitimes_instant_clock_gettime.c} +0 -0
- data/ext/hitimes/c/hitimes_instant_osx.c +45 -0
- data/ext/hitimes/{hitimes_instant_windows.c → c/hitimes_instant_windows.c} +0 -0
- data/ext/hitimes/{hitimes_interval.c → c/hitimes_interval.c} +15 -7
- data/ext/hitimes/{hitimes_interval.h → c/hitimes_interval.h} +5 -5
- data/ext/hitimes/{hitimes_stats.c → c/hitimes_stats.c} +0 -0
- data/ext/hitimes/{hitimes_stats.h → c/hitimes_stats.h} +0 -0
- data/ext/hitimes/java/src/hitimes/Hitimes.java +54 -0
- data/ext/hitimes/java/src/hitimes/HitimesInterval.java +181 -0
- data/ext/hitimes/java/src/hitimes/HitimesService.java +16 -0
- data/ext/hitimes/java/src/hitimes/HitimesStats.java +112 -0
- data/lib/hitimes.rb +15 -5
- data/lib/hitimes/1.9/hitimes.so +0 -0
- data/lib/hitimes/2.0/hitimes.so +0 -0
- data/lib/hitimes/2.1/hitimes.so +0 -0
- data/lib/hitimes/version.rb +1 -50
- data/spec/hitimes_spec.rb +14 -0
- data/spec/interval_spec.rb +40 -37
- data/spec/metric_spec.rb +8 -10
- data/spec/mutex_stats_spec.rb +10 -8
- data/spec/paths_spec.rb +3 -5
- data/spec/spec_helper.rb +9 -3
- data/spec/stats_spec.rb +28 -30
- data/spec/timed_metric_spec.rb +42 -42
- data/spec/timed_value_metric_spec.rb +54 -55
- data/spec/value_metric_spec.rb +26 -28
- data/spec/version_spec.rb +4 -30
- data/tasks/default.rake +242 -0
- data/tasks/extension.rake +31 -101
- data/tasks/this.rb +206 -0
- metadata +158 -145
- data/README +0 -135
- data/ext/hitimes/extconf.rb +0 -17
- data/ext/hitimes/hitimes_instant_osx.c +0 -16
- data/gemspec.rb +0 -64
- data/lib/hitimes/1.8/hitimes_ext.so +0 -0
- data/lib/hitimes/1.9/hitimes_ext.so +0 -0
- data/tasks/announce.rake +0 -42
- data/tasks/config.rb +0 -109
- data/tasks/distribution.rake +0 -93
- data/tasks/documentation.rake +0 -32
- data/tasks/rspec.rake +0 -33
- data/tasks/rubyforge.rake +0 -55
- data/tasks/utils.rb +0 -80
data/tasks/documentation.rake
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'tasks/config'
|
2
|
-
|
3
|
-
#-----------------------------------------------------------------------
|
4
|
-
# Documentation
|
5
|
-
#-----------------------------------------------------------------------
|
6
|
-
|
7
|
-
if rdoc_config = Configuration.for_if_exist?('rdoc') then
|
8
|
-
|
9
|
-
namespace :doc do
|
10
|
-
|
11
|
-
require 'rdoc'
|
12
|
-
require 'rake/rdoctask'
|
13
|
-
|
14
|
-
# generating documentation locally
|
15
|
-
Rake::RDocTask.new do |rdoc|
|
16
|
-
rdoc.rdoc_dir = rdoc_config.output_dir
|
17
|
-
rdoc.options = rdoc_config.options
|
18
|
-
rdoc.rdoc_files = rdoc_config.files.sort
|
19
|
-
rdoc.title = rdoc_config.title
|
20
|
-
rdoc.main = rdoc_config.main_page
|
21
|
-
end
|
22
|
-
|
23
|
-
if rubyforge_config = Configuration.for_if_exist?('rubyforge') then
|
24
|
-
desc "Deploy the RDoc documentation to #{rubyforge_config.rdoc_location}"
|
25
|
-
task :deploy => :rerdoc do
|
26
|
-
sh "rsync -zav --delete #{rdoc_config.output_dir}/ #{rubyforge_config.rdoc_location}"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
data/tasks/rspec.rake
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'tasks/config'
|
3
|
-
|
4
|
-
#--------------------------------------------------------------------------------
|
5
|
-
# configuration for running rspec. This shows up as the test:default task
|
6
|
-
#--------------------------------------------------------------------------------
|
7
|
-
if spec_config = Configuration.for_if_exist?("test") then
|
8
|
-
if spec_config.mode == "spec" then
|
9
|
-
namespace :test do
|
10
|
-
|
11
|
-
task :default => :spec
|
12
|
-
|
13
|
-
require 'spec/rake/spectask'
|
14
|
-
Spec::Rake::SpecTask.new do |r|
|
15
|
-
r.ruby_opts = spec_config.ruby_opts
|
16
|
-
r.libs = [ Hitimes::Paths.lib_path,
|
17
|
-
Hitimes::Paths.root_dir ]
|
18
|
-
r.spec_files = spec_config.files
|
19
|
-
r.spec_opts = spec_config.options
|
20
|
-
|
21
|
-
if rcov_config = Configuration.for_if_exist?('rcov') then
|
22
|
-
r.rcov = true
|
23
|
-
r.rcov_dir = rcov_config.output_dir
|
24
|
-
r.rcov_opts = rcov_config.rcov_opts
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
pre_req = "ext:build"
|
29
|
-
pre_req += "_java" if RUBY_PLATFORM == "java"
|
30
|
-
task :spec => pre_req
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
data/tasks/rubyforge.rake
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'tasks/config'
|
2
|
-
|
3
|
-
#-----------------------------------------------------------------------
|
4
|
-
# Rubyforge additions to the task library
|
5
|
-
#-----------------------------------------------------------------------
|
6
|
-
if rf_conf = Configuration.for_if_exist?("rubyforge") then
|
7
|
-
|
8
|
-
abort("rubyforge gem not installed 'gem install rubyforge'") unless Utils.try_require('rubyforge')
|
9
|
-
|
10
|
-
proj_conf = Configuration.for('project')
|
11
|
-
|
12
|
-
namespace :dist do
|
13
|
-
desc "Release files to rubyforge"
|
14
|
-
task :rubyforge => [:clean, :package, :package_win] do
|
15
|
-
|
16
|
-
rubyforge = RubyForge.new
|
17
|
-
|
18
|
-
config = {}
|
19
|
-
config["release_notes"] = proj_conf.description
|
20
|
-
config["release_changes"] = Utils.release_notes_from(proj_conf.history)[Hitimes::VERSION]
|
21
|
-
config["Prefomatted"] = true
|
22
|
-
|
23
|
-
|
24
|
-
rubyforge.configure config
|
25
|
-
|
26
|
-
# make sure this release doesn't already exist
|
27
|
-
releases = rubyforge.autoconfig['release_ids']
|
28
|
-
if releases.has_key?(Hitimes::GEM_SPEC.name) and releases[Hitimes::GEM_SPEC.name][Hitimes::VERSION] then
|
29
|
-
abort("Release #{Hitimes::VERSION} already exists! Unable to release.")
|
30
|
-
end
|
31
|
-
|
32
|
-
puts "Uploading to rubyforge..."
|
33
|
-
files = FileList[File.join("pkg","#{Hitimes::GEM_SPEC.name}-#{Hitimes::VERSION}*.*")].to_a
|
34
|
-
files.each do |f|
|
35
|
-
puts " * #{f}"
|
36
|
-
end
|
37
|
-
rubyforge.login
|
38
|
-
rubyforge.add_release(Hitimes::GEM_SPEC.rubyforge_project, Hitimes::GEM_SPEC.name, Hitimes::VERSION, *files)
|
39
|
-
puts "done."
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
namespace :announce do
|
44
|
-
desc "Post news of #{proj_conf.name} to #{rf_conf.project} on rubyforge"
|
45
|
-
task :rubyforge do
|
46
|
-
info = Utils.announcement
|
47
|
-
rubyforge = RubyForge.new
|
48
|
-
rubyforge.configure
|
49
|
-
rubyforge.login
|
50
|
-
rubyforge.post_news(rf_conf.project, info[:subject], "#{info[:title]}\n\n#{info[:urls]}\n\n#{info[:release_notes]}")
|
51
|
-
puts "Posted to rubyforge"
|
52
|
-
end
|
53
|
-
|
54
|
-
end
|
55
|
-
end
|
data/tasks/utils.rb
DELETED
@@ -1,80 +0,0 @@
|
|
1
|
-
require 'hitimes/version'
|
2
|
-
|
3
|
-
#-------------------------------------------------------------------------------
|
4
|
-
# Additions to the Configuration class that are useful
|
5
|
-
#-------------------------------------------------------------------------------
|
6
|
-
class Configuration
|
7
|
-
class << self
|
8
|
-
def exist?( name )
|
9
|
-
Configuration::Table.has_key?( name )
|
10
|
-
end
|
11
|
-
|
12
|
-
def for_if_exist?( name )
|
13
|
-
if self.exist?( name ) then
|
14
|
-
self.for( name )
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
#-------------------------------------------------------------------------------
|
21
|
-
# some useful utilitiy methods for the tasks
|
22
|
-
#-------------------------------------------------------------------------------
|
23
|
-
module Utils
|
24
|
-
class << self
|
25
|
-
|
26
|
-
# Try to load the given _library_ using the built-in require, but do not
|
27
|
-
# raise a LoadError if unsuccessful. Returns +true+ if the _library_ was
|
28
|
-
# successfully loaded; returns +false+ otherwise.
|
29
|
-
#
|
30
|
-
def try_require( lib )
|
31
|
-
require lib
|
32
|
-
true
|
33
|
-
rescue LoadError
|
34
|
-
false
|
35
|
-
end
|
36
|
-
|
37
|
-
# partition an rdoc file into sections, and return the text of the section
|
38
|
-
# given.
|
39
|
-
def section_of(file, section_name)
|
40
|
-
File.read(file).split(/^(?==)/).each do |section|
|
41
|
-
lines = section.split("\n")
|
42
|
-
return lines[1..-1].join("\n").strip if lines.first =~ /#{section_name}/i
|
43
|
-
end
|
44
|
-
nil
|
45
|
-
end
|
46
|
-
|
47
|
-
# Get an array of all the changes in the application for a particular
|
48
|
-
# release. This is done by looking in the history file and grabbing the
|
49
|
-
# information for the most recent release. The history file is assumed to
|
50
|
-
# be in RDoc format and version release are 2nd tier sections separated by
|
51
|
-
# '== Version X.Y.Z'
|
52
|
-
#
|
53
|
-
# returns:: A hash of notes keyed by version number
|
54
|
-
#
|
55
|
-
def release_notes_from(history_file)
|
56
|
-
releases = {}
|
57
|
-
File.read(history_file).split(/^(?=== Version)/).each do |section|
|
58
|
-
lines = section.split("\n")
|
59
|
-
md = %r{Version ((\w+\.)+\w+)}.match(lines.first)
|
60
|
-
next unless md
|
61
|
-
releases[md[1]] = lines[1..-1].join("\n").strip
|
62
|
-
end
|
63
|
-
return releases
|
64
|
-
end
|
65
|
-
|
66
|
-
# return a hash of useful information for the latest release
|
67
|
-
# urls, subject, title, description and latest release notes
|
68
|
-
#
|
69
|
-
def announcement
|
70
|
-
cfg = Configuration.for("project")
|
71
|
-
{
|
72
|
-
:subject => "#{cfg.name} #{Hitimes::VERSION} Released",
|
73
|
-
:title => "#{cfg.name} version #{Hitimes::VERSION} has been released.",
|
74
|
-
:urls => "#{cfg.homepage}",
|
75
|
-
:description => "#{cfg.description.rstrip}",
|
76
|
-
:release_notes => Utils.release_notes_from(cfg.history)[Hitimes::VERSION].rstrip
|
77
|
-
}
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end # << self
|