Sha256: 5490e4911ad9b60926da3568a5b1c362a7da73bbfc0c9b19a3cc5b5295374aca

Contents?: true

Size: 660 Bytes

Versions: 5

Compression:

Stored size: 660 Bytes

Contents

module Rearview
  class StatsService
    class StatsServiceError < StandardError; end;
    include Celluloid
    include Rearview::Logger
    def statsd
      @statsd ||= Rearview::Statsd.new
      if block_given? && Rearview.config.stats_enabled?
        yield @statsd
      end
      @statsd
    end
    def started?
      @started
    end
    def startup
      raise StatsServiceError.new("service already started") if started?
      @started = true
      @stats_task = Rearview::StatsTask.supervise
    end
    def shutdown
      raise StatsServiceError.new("service not started") unless started?
      @stats_task.actors.first.terminate
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rearview-1.1.2-jruby lib/rearview/stats_service.rb
rearview-1.1.1-jruby lib/rearview/stats_service.rb
rearview-1.1.0-jruby lib/rearview/stats_service.rb
rearview-1.0.3.rc.4-jruby lib/rearview/stats_service.rb
rearview-1.0.3.rc.3-jruby lib/rearview/stats_service.rb