oml4r 2.9.4 → 2.9.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/oml4r/benchmark.rb +10 -10
- data/lib/oml4r/version.rb +1 -1
- data/lib/oml4r.rb +1 -1
- metadata +42 -25
data/lib/oml4r/benchmark.rb
CHANGED
@@ -8,26 +8,26 @@
|
|
8
8
|
#
|
9
9
|
# == Description
|
10
10
|
#
|
11
|
-
# Provides convenience functions to monitor long running services and
|
11
|
+
# Provides convenience functions to monitor long running services and
|
12
12
|
# report performance metrics through OML
|
13
13
|
#
|
14
14
|
require 'oml4r'
|
15
15
|
|
16
16
|
module OML4R
|
17
17
|
#
|
18
|
-
# Monitor the CPU consumption of a block and report it to
|
18
|
+
# Monitor the CPU consumption of a block and report it to
|
19
19
|
# OML
|
20
20
|
#
|
21
21
|
class Benchmark
|
22
22
|
|
23
|
-
def self.bm(label, opts = {}, &block)
|
23
|
+
def self.bm(label, opts = {}, &block)
|
24
24
|
inst = self.new(label, opts)
|
25
25
|
inst.measure(&block) if block
|
26
26
|
inst
|
27
27
|
end
|
28
28
|
|
29
29
|
# Measure execution of 'block'. Benchmarking is assumed
|
30
|
-
# to be finished when block finished. Don't attempt to
|
30
|
+
# to be finished when block finished. Don't attempt to
|
31
31
|
# call again
|
32
32
|
#
|
33
33
|
def measure(&block)
|
@@ -37,7 +37,7 @@ module OML4R
|
|
37
37
|
_stop
|
38
38
|
end
|
39
39
|
|
40
|
-
# Execute block and add execution time to overall
|
40
|
+
# Execute block and add execution time to overall
|
41
41
|
# measurements. Can be called multiple time. Need
|
42
42
|
# to finally call '#stop' to report overall stats.
|
43
43
|
#
|
@@ -56,7 +56,7 @@ module OML4R
|
|
56
56
|
|
57
57
|
if @monitor_interval > 0
|
58
58
|
Thread.new do
|
59
|
-
while @running
|
59
|
+
while @running
|
60
60
|
sleep @monitor_interval
|
61
61
|
_report()
|
62
62
|
end
|
@@ -203,14 +203,14 @@ end
|
|
203
203
|
if __FILE__ == $0
|
204
204
|
opts = {
|
205
205
|
:appName => 'bm_test',
|
206
|
-
:domain => 'foo',
|
206
|
+
:domain => 'foo',
|
207
207
|
:nodeID => 'n1',
|
208
208
|
:collect => 'file:-'
|
209
|
-
}
|
209
|
+
}
|
210
210
|
OML4R::init(ARGV, opts)
|
211
211
|
|
212
|
-
bm_i = OML4R::Benchmark.bm('inner_test', periodic
|
213
|
-
OML4R::Benchmark.bm('test', periodic
|
212
|
+
bm_i = OML4R::Benchmark.bm('inner_test', :periodic => 0.1)
|
213
|
+
OML4R::Benchmark.bm('test', :periodic => 0.1) do |bm|
|
214
214
|
20.times do |i|
|
215
215
|
10.times do
|
216
216
|
"a" * 1_000_000
|
data/lib/oml4r/version.rb
CHANGED
data/lib/oml4r.rb
CHANGED
metadata
CHANGED
@@ -1,23 +1,33 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: oml4r
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 33
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 2
|
8
|
+
- 9
|
9
|
+
- 5
|
10
|
+
version: 2.9.5
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- NICTA
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
17
|
+
|
18
|
+
date: 2013-09-02 00:00:00 Z
|
13
19
|
dependencies: []
|
14
|
-
|
15
|
-
|
20
|
+
|
21
|
+
description: Simple OML client library for Ruby
|
22
|
+
email:
|
16
23
|
- oml-user@lists.nicta.com.au
|
17
24
|
executables: []
|
25
|
+
|
18
26
|
extensions: []
|
27
|
+
|
19
28
|
extra_rdoc_files: []
|
20
|
-
|
29
|
+
|
30
|
+
files:
|
21
31
|
- .gitignore
|
22
32
|
- Gemfile
|
23
33
|
- LICENSE.txt
|
@@ -37,31 +47,38 @@ files:
|
|
37
47
|
- lib/oml4r/version.rb
|
38
48
|
- oml4r.gemspec
|
39
49
|
homepage: http://oml.mytestbed.net
|
40
|
-
licenses:
|
50
|
+
licenses:
|
41
51
|
- MIT
|
42
52
|
post_install_message:
|
43
53
|
rdoc_options: []
|
44
|
-
|
54
|
+
|
55
|
+
require_paths:
|
45
56
|
- lib
|
46
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
47
58
|
none: false
|
48
|
-
requirements:
|
49
|
-
- -
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
|
52
|
-
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 3
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
version: "0"
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
67
|
none: false
|
54
|
-
requirements:
|
55
|
-
- -
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
58
75
|
requirements: []
|
76
|
+
|
59
77
|
rubyforge_project:
|
60
|
-
rubygems_version: 1.8.
|
78
|
+
rubygems_version: 1.8.25
|
61
79
|
signing_key:
|
62
80
|
specification_version: 3
|
63
|
-
summary:
|
64
|
-
its filters, but connects directly to the server using the +text+ protocol. User
|
65
|
-
can use this library to create ruby applications which can send measurement to the
|
66
|
-
OML collection server."]'
|
81
|
+
summary: This is a simple client library for OML which does not use liboml2 and its filters, but connects directly to the server using the +text+ protocol. User can use this library to create ruby applications which can send measurement to the OML collection server.
|
67
82
|
test_files: []
|
83
|
+
|
84
|
+
has_rdoc:
|