rubycut-metriks 0.9.9.4 → 0.9.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/metriks/gauge.rb +27 -0
  2. data/metriks.gemspec +4 -3
  3. metadata +85 -69
@@ -0,0 +1,27 @@
1
+ require 'atomic'
2
+
3
+ module Metriks
4
+ class Gauge
5
+ # Public: Initialize a new Gauge.
6
+ def initialize(callable = nil, &block)
7
+ @gauge = Atomic.new(nil)
8
+ @callback = callable || block
9
+ end
10
+
11
+ # Public: Set a new value.
12
+ #
13
+ # val - The new value.
14
+ #
15
+ # Returns nothing.
16
+ def set(val)
17
+ @gauge.value = val
18
+ end
19
+
20
+ # Public: The current value.
21
+ #
22
+ # Returns the gauge value.
23
+ def value
24
+ @callback ? @callback.call : @gauge.value
25
+ end
26
+ end
27
+ end
data/metriks.gemspec CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'rubycut-metriks'
16
- s.version = '0.9.9.4'
17
- s.date = '2013-02-22'
16
+ s.version = '0.9.9.5'
17
+ s.date = '2013-04-28'
18
18
 
19
19
  ## Make sure your summary is short. The description may be as long
20
20
  ## as you like.
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  ## a custom homepage, consider using your GitHub URL or the like.
27
27
  s.authors = ["Eric Lindvall"]
28
28
  s.email = 'eric@sevenscale.com'
29
- s.homepage = 'https://github.com/eric/metriks'
29
+ s.homepage = 'https://github.com/rubycut/metriks'
30
30
 
31
31
  ## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
32
32
  ## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
@@ -61,6 +61,7 @@ Gem::Specification.new do |s|
61
61
  lib/metriks.rb
62
62
  lib/metriks/counter.rb
63
63
  lib/metriks/ewma.rb
64
+ lib/metriks/gauge.rb
64
65
  lib/metriks/exponentially_decaying_sample.rb
65
66
  lib/metriks/histogram.rb
66
67
  lib/metriks/meter.rb
metadata CHANGED
@@ -1,88 +1,94 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rubycut-metriks
3
- version: !ruby/object:Gem::Version
4
- version: 0.9.9.4
3
+ version: !ruby/object:Gem::Version
4
+ hash: 41
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 9
9
+ - 9
10
+ - 5
11
+ version: 0.9.9.5
6
12
  platform: ruby
7
- authors:
13
+ authors:
8
14
  - Eric Lindvall
9
15
  autorequire:
10
16
  bindir: bin
11
17
  cert_chain: []
12
- date: 2013-02-22 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
18
+
19
+ date: 2013-04-28 00:00:00 Z
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
15
22
  name: atomic
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: '1.0'
22
- type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
- requirements:
26
+ requirements:
27
27
  - - ~>
28
- - !ruby/object:Gem::Version
29
- version: '1.0'
30
- - !ruby/object:Gem::Dependency
31
- name: hitimes
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ~>
36
- - !ruby/object:Gem::Version
37
- version: '1.1'
28
+ - !ruby/object:Gem::Version
29
+ hash: 15
30
+ segments:
31
+ - 1
32
+ - 0
33
+ version: "1.0"
38
34
  type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: hitimes
39
38
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
39
+ requirement: &id002 !ruby/object:Gem::Requirement
41
40
  none: false
42
- requirements:
41
+ requirements:
43
42
  - - ~>
44
- - !ruby/object:Gem::Version
45
- version: '1.1'
46
- - !ruby/object:Gem::Dependency
47
- name: avl_tree
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ~>
52
- - !ruby/object:Gem::Version
53
- version: 1.1.2
43
+ - !ruby/object:Gem::Version
44
+ hash: 13
45
+ segments:
46
+ - 1
47
+ - 1
48
+ version: "1.1"
54
49
  type: :runtime
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ name: avl_tree
55
53
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
54
+ requirement: &id003 !ruby/object:Gem::Requirement
57
55
  none: false
58
- requirements:
56
+ requirements:
59
57
  - - ~>
60
- - !ruby/object:Gem::Version
58
+ - !ruby/object:Gem::Version
59
+ hash: 23
60
+ segments:
61
+ - 1
62
+ - 1
63
+ - 2
61
64
  version: 1.1.2
62
- - !ruby/object:Gem::Dependency
65
+ type: :runtime
66
+ version_requirements: *id003
67
+ - !ruby/object:Gem::Dependency
63
68
  name: mocha
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ~>
68
- - !ruby/object:Gem::Version
69
- version: '0.10'
70
- type: :development
71
69
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
70
+ requirement: &id004 !ruby/object:Gem::Requirement
73
71
  none: false
74
- requirements:
72
+ requirements:
75
73
  - - ~>
76
- - !ruby/object:Gem::Version
77
- version: '0.10'
74
+ - !ruby/object:Gem::Version
75
+ hash: 31
76
+ segments:
77
+ - 0
78
+ - 10
79
+ version: "0.10"
80
+ type: :development
81
+ version_requirements: *id004
78
82
  description: An experimental metrics client.
79
83
  email: eric@sevenscale.com
80
84
  executables: []
85
+
81
86
  extensions: []
82
- extra_rdoc_files:
87
+
88
+ extra_rdoc_files:
83
89
  - README.md
84
90
  - LICENSE
85
- files:
91
+ files:
86
92
  - Gemfile
87
93
  - LICENSE
88
94
  - README.md
@@ -91,6 +97,7 @@ files:
91
97
  - lib/metriks.rb
92
98
  - lib/metriks/counter.rb
93
99
  - lib/metriks/ewma.rb
100
+ - lib/metriks/gauge.rb
94
101
  - lib/metriks/exponentially_decaying_sample.rb
95
102
  - lib/metriks/histogram.rb
96
103
  - lib/metriks/meter.rb
@@ -121,32 +128,40 @@ files:
121
128
  - test/thread_error_handling_tests.rb
122
129
  - test/timer_test.rb
123
130
  - test/utilization_timer_test.rb
124
- homepage: https://github.com/eric/metriks
131
+ homepage: https://github.com/rubycut/metriks
125
132
  licenses: []
133
+
126
134
  post_install_message:
127
- rdoc_options:
135
+ rdoc_options:
128
136
  - --charset=UTF-8
129
- require_paths:
137
+ require_paths:
130
138
  - lib
131
- required_ruby_version: !ruby/object:Gem::Requirement
139
+ required_ruby_version: !ruby/object:Gem::Requirement
132
140
  none: false
133
- requirements:
134
- - - ! '>='
135
- - !ruby/object:Gem::Version
136
- version: '0'
137
- required_rubygems_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ hash: 3
145
+ segments:
146
+ - 0
147
+ version: "0"
148
+ required_rubygems_version: !ruby/object:Gem::Requirement
138
149
  none: false
139
- requirements:
140
- - - ! '>='
141
- - !ruby/object:Gem::Version
142
- version: '0'
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ hash: 3
154
+ segments:
155
+ - 0
156
+ version: "0"
143
157
  requirements: []
158
+
144
159
  rubyforge_project:
145
160
  rubygems_version: 1.8.25
146
161
  signing_key:
147
162
  specification_version: 2
148
163
  summary: An experimental metrics client
149
- test_files:
164
+ test_files:
150
165
  - test/counter_test.rb
151
166
  - test/graphite_reporter_test.rb
152
167
  - test/histogram_test.rb
@@ -159,3 +174,4 @@ test_files:
159
174
  - test/riemann_reporter_test.rb
160
175
  - test/timer_test.rb
161
176
  - test/utilization_timer_test.rb
177
+ has_rdoc: