Module: Vitals
- Defined in:
- lib/vitals.rb,
lib/vitals.rb,
lib/vitals/utils.rb,
lib/vitals/version.rb,
lib/vitals/configuration.rb
Defined Under Namespace
Modules: Formats, Integrations, Reporters, Utils
Classes: Configuration
Constant Summary
collapse
- VERSION =
"0.9.1"
Class Method Summary
collapse
Class Method Details
25
26
27
28
29
30
|
# File 'lib/vitals.rb', line 25
def self.configure!
@config = Configuration.new
yield(@config) if block_given?
@reporter = @config.reporter
@reporter.format = @config.build_format
end
|
.gauge(m, val) ⇒ Object
62
63
64
|
# File 'lib/vitals.rb', line 62
def self.gauge(m, val)
reporter.gauge(m, val)
end
|
.inc(m) ⇒ Object
reporter delegators
hardwired for performance (forwardable delegators go through __send__ and generate gc waste)
54
55
56
|
# File 'lib/vitals.rb', line 54
def self.inc(m)
reporter.inc(m)
end
|
.reporter ⇒ Object
36
37
38
|
# File 'lib/vitals.rb', line 36
def self.reporter
@reporter
end
|
.reporter=(r) ⇒ Object
32
33
34
|
# File 'lib/vitals.rb', line 32
def self.reporter=(r)
@reporter = r
end
|
.subscribe!(*modules) ⇒ Object
40
41
42
43
44
45
46
47
|
# File 'lib/vitals.rb', line 40
def self.subscribe!(*modules)
modules.map do |mod|
require "vitals/integrations/notifications/#{ mod }"
klass = Object.const_get("Vitals::Integrations::Notifications::#{classify(mod)}")
klass.subscribe!
end
end
|
.timing(m, val) ⇒ Object
58
59
60
|
# File 'lib/vitals.rb', line 58
def self.timing(m, val)
reporter.timing(m, val)
end
|