counters 1.0.0 → 1.0.1
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/counters.gemspec +1 -1
- data/lib/counters/base.rb +3 -1
- data/lib/counters/version.rb +1 -1
- metadata +3 -3
data/counters.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["François Beausoleil"]
|
10
10
|
s.email = ["francois@teksol.info"]
|
11
|
-
s.homepage = ""
|
11
|
+
s.homepage = "https://github.com/francois/counters"
|
12
12
|
s.summary = %q{Provides an API to record any kind of metrics within your system}
|
13
13
|
s.description = %q{Using the provided API, record metrics (such as number of hits to a particular controller, bytes in/out, compression ratio) within your system. Visualization is NOT provided within this gem.}
|
14
14
|
|
data/lib/counters/base.rb
CHANGED
@@ -11,13 +11,15 @@ module Counters
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def latency(key, time_in_seconds=nil)
|
14
|
+
result = nil
|
14
15
|
validate(key)
|
15
16
|
if block_given? then
|
16
17
|
raise ArgumentError, "Must pass either a latency or a block, not both: received #{time_in_seconds.inspect} in addition to a block" if time_in_seconds
|
17
|
-
time_in_seconds = Benchmark.measure { yield }.real
|
18
|
+
time_in_seconds = Benchmark.measure { result = yield }.real
|
18
19
|
end
|
19
20
|
|
20
21
|
record_latency(key, time_in_seconds)
|
22
|
+
result
|
21
23
|
end
|
22
24
|
|
23
25
|
def ping(key)
|
data/lib/counters/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 1
|
9
|
+
version: 1.0.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Fran\xC3\xA7ois Beausoleil"
|
@@ -72,7 +72,7 @@ files:
|
|
72
72
|
- spec/redis_counter_spec.rb
|
73
73
|
- spec/spec_helper.rb
|
74
74
|
has_rdoc: true
|
75
|
-
homepage:
|
75
|
+
homepage: https://github.com/francois/counters
|
76
76
|
licenses: []
|
77
77
|
|
78
78
|
post_install_message:
|