module Observed

The module to provide DSL to describe Observed configuration, intended to be used by including to Ruby's `main` object like Clockwork(github.com/tomykaira/clockwork) does in their configuration file(a.k.a `clockwork.rb`).

Take this as the `Builder` for Observed's configuration which is has global state. As it has global state, we have to call `Observed#init!` before building multiple Observed configurations through this module.

@example require 'observed' include Observed

require 'observed/http' require_relative 'your_plugin'

observe 'myservice.response', { plugin: 'http', method: 'get', url: 'localhost:3000' } report /myservice.response/, { plugin: 'stdout' }

#=> Now we can obtain the described configuration by calling `Observed.config`

Constants

VERSION

Public Class Methods

ensure_singleton_initialized() click to toggle source
# File lib/observed.rb, line 59
def ensure_singleton_initialized
  @@singleton ||= begin
    s = Singleton.new
    s.init!
    s
  end
end
extended(klass) click to toggle source
# File lib/observed.rb, line 55
def extended(klass)
  ensure_singleton_initialized
end
included(klass) click to toggle source
# File lib/observed.rb, line 51
def included(klass)
  ensure_singleton_initialized
end