Commit 766e717e authored by Paul Asmuth's avatar Paul Asmuth
Browse files

options: enable_active_users and enable_gauge_explorer

parent 0145af7e
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -11,12 +11,14 @@ class FnordMetric::Namespace
    @gauges = Hash.new
    @dashboards = Hash.new
    @handlers = Hash.new.with_indifferent_access
    @flags = Hash.new
    @title = key
    @active_users_available = true
    @gauge_explorer_available = true
    @opts = opts
    @key = key

    @flags = {
      :hide_active_users => (FnordMetric.options[:enable_active_users] == false),
      :hide_gauge_explorer => (FnordMetric.options[:enable_gauge_explorer] == false)
    }
  end

  def ready!(redis, sync_redis = nil)
@@ -27,7 +29,7 @@ class FnordMetric::Namespace
  end

  def announce(event)
    if active_users_available
    if !@flags[:hide_active_users]
      announce_to_timeline(event)
      announce_to_typelist(event)
    end
@@ -88,14 +90,6 @@ class FnordMetric::Namespace
    @title
  end

  def active_users_available
    !!@active_users_available
  end

  def gauge_explorer_available
    !!@active_users_available
  end

  def dashboards(name=nil, opts = {})
    return @dashboards unless name
    dash = FnordMetric::Dashboard.new(opts.merge(:title => name))
+4 −0
Original line number Diff line number Diff line
@@ -12,4 +12,8 @@ FnordMetric.namespace :myapp do

end

FnordMetric.options = {
  :enable_gauge_explorer => false
}

FnordMetric.standalone
+41 −4
Original line number Diff line number Diff line
@@ -69,7 +69,44 @@ _Example: This will start a worker_

### Configuration

fixpaul: fnordmetric config

fixpaul: redis config
FIXPAUL!

    FnordMetric.options = {
      ...
    }


<table>
  <tr>
    <th>default_flush_interval</th>
    <td>
      default gauge flush interval, default value is 10 seconds
    </td>
  </tr>
  <tr>
    <th>enable_active_users</th>
    <td>
      enable the active users plugin, default value is true
    </td>
  </tr>
  <tr>
    <th>enable_gauge_explorer</th>
    <td>
      enable the gauge explorer plugin, default value is true
    </td>
  </tr>
</table>
<br />


      :redis_url => "redis://localhost:6379",
      :redis_prefix => "fnordmetric",
      :inbound_stream => ["0.0.0.0", "1337"],
      :inbound_protocol => :tcp,
      :web_interface => ["0.0.0.0", "4242"],
      :web_interface_server => "thin",
      :start_worker => true,
      :print_stats => 3,
      :event_queue_ttl => 120,
      :event_data_ttl => 3600*24*30,
      :session_data_ttl => 3600*24*30