Commit 93676104 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

wip

parent fd892950
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -36,11 +36,12 @@ class FnordMetric::TCPAcceptor < EventMachine::Connection
  end

  def close_connection?
    @backend.hangup unless @streaming || (@events_buffered!=0)
    #@backend.hangup unless @streaming || (@events_buffered!=0)
  end

  def post_init
    @backend = FnordMetric.backend
    puts options.inspect
    @backend = options[:backend][0].new(options[:backend][1])
    @events_buffered = 0
    @streaming = true
    @buffer = ""
+3 −5
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@ class FnordMetric::UDPAcceptor < EventMachine::Connection
  def self.start(opts)
    self.opts = opts

    @backend = @opts[:backend][0].new(@opts[:backend][1])

    EM.open_datagram_socket(*(opts[:listen] << self << opts))
  end

@@ -23,11 +25,7 @@ class FnordMetric::UDPAcceptor < EventMachine::Connection
  end

  def unbind
    backend.hangup
  end

  def backend
    @backend ||= FnordMetric.backend
    #backend.hangup
  end

  def events
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ class FnordMetric::App < Sinatra::Base
  set :haml, :format => :html5
  set :views, ::File.expand_path('../../../../haml', __FILE__)

  def initialize(namespaces, opts)
  def initialize(opts)
    @namespaces = {}
    @redis = Redis.connect(:url => opts[:redis_url])
    @opts = opts
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ class FnordMetric::Web

  def initialized   
    server = @opts[:server].downcase
    app = FnordMetric::App.new(@@namespaces.clone, @opts)
    app = FnordMetric::App.new(@opts)

    unless ["thin", "hatetepe"].include? server
      raise "Need an EventMachine webserver, but #{server} isn't"
+1 −0
Original line number Diff line number Diff line
body, html{ height:100%; padding:0px;}
body{ background:url('img/head.png') 0 -21px repeat-x fixed #2E3133; color:#333; margin:0; padding:0; overflow-y:scroll; font: 12px/20px "Helvetica Neue", Helvetica, Arial, sans-serif; padding-bottom:30px; overflow-x:hidden; }


h1{
  font-size:24px;
  color:#333;