cabin 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cabin/channel.rb +2 -0
- data/test/test_metrics.rb +6 -0
- metadata +3 -3
data/lib/cabin/channel.rb
CHANGED
@@ -44,6 +44,7 @@ require "logger"
|
|
44
44
|
#
|
45
45
|
class Cabin::Channel
|
46
46
|
include Cabin::Mixins::Logger
|
47
|
+
attr_accessor :metrics
|
47
48
|
|
48
49
|
# Create a new logging channel.
|
49
50
|
# The default log level is 'info'
|
@@ -52,6 +53,7 @@ class Cabin::Channel
|
|
52
53
|
@outputs = []
|
53
54
|
@data = {}
|
54
55
|
@level = :info
|
56
|
+
@metrics = Cabin::Metrics.new
|
55
57
|
end # def initialize
|
56
58
|
|
57
59
|
# Subscribe a new input
|
data/test/test_metrics.rb
CHANGED
@@ -49,6 +49,12 @@ describe Cabin::Metrics do
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
test "metrics from logger" do
|
53
|
+
@logger = Cabin::Channel.new
|
54
|
+
meter = @logger.metrics.meter(self)
|
55
|
+
assert_equal(0, meter.value)
|
56
|
+
end
|
57
|
+
|
52
58
|
test "timer histogram" # TODO(sissel): implement
|
53
59
|
test "histogram" # TODO(sissel): implement
|
54
60
|
end # describe Cabin::Channel do
|
metadata
CHANGED