Module: Yabeda::DSL::ClassMethods

Defined in:
lib/yabeda/dsl.rb

Instance Method Summary collapse

Instance Method Details

#collect(&block) ⇒ Object



20
21
22
# File 'lib/yabeda/dsl.rb', line 20

def collect(&block)
  ::Yabeda.collectors.push(block)
end

#configure(&block) ⇒ Object



15
16
17
18
# File 'lib/yabeda/dsl.rb', line 15

def configure(&block)
  class_exec(&block)
  @group = nil
end

#counter(*args, **kwargs) ⇒ Object



28
29
30
# File 'lib/yabeda/dsl.rb', line 28

def counter(*args, **kwargs)
  register(Counter.new(*args, **kwargs, group: @group))
end

#gauge(*args, **kwargs) ⇒ Object



32
33
34
# File 'lib/yabeda/dsl.rb', line 32

def gauge(*args, **kwargs)
  register(Gauge.new(*args, **kwargs, group: @group))
end

#group(group_name) ⇒ Object



24
25
26
# File 'lib/yabeda/dsl.rb', line 24

def group(group_name)
  @group = group_name
end

#histogram(*args, **kwargs) ⇒ Object



36
37
38
# File 'lib/yabeda/dsl.rb', line 36

def histogram(*args, **kwargs)
  register(Histogram.new(*args, **kwargs, group: @group))
end