Commit 3fd6dbb4 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

implemented gauge units

parent 35ee8ce5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -34,6 +34,10 @@ class FnordMetric::Gauge
    @opts[:group] || "Gauges"
  end

  def unit
    @opts[:unit]
  end

  def key_nouns
    @opts[:key_nouns] || ["Key", "Keys"]
  end
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ class FnordMetric::NumbersWidget < FnordMetric::Widget
    super.merge(
      :series => gauges.map(&:name),
      :series_titles => gauges.map(&:title),
      :series_units => Hash[gauges.map{ |g| [g.name, g.unit] }],
      :offsets => (@opts[:offsets] || [0, 1, "s30"]),
      :autoupdate => (@opts[:autoupdate] || 60)
    )
+3 −2
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ Todos
  → simple gauge explorer (style like active users) + iframe snippet generator
  → hooks for custom css, js
  → linux/server monitor gauge (http://www.crunchbase.com/assets/images/original/0010/3221/103221v2.png)+ 
  → icons for sidear
  → big screen view
  → alerts
  → make it responsive
@@ -15,7 +16,7 @@ Todos
Done
====

added :scale_by option for gauges
gauge human_titles, units, scale_by
  → added fyrehose acceptor
  → explicit dashboard initialization with options -> dashboard grouping
  → bugfix: gauge titles
  → bugfix: lot's of small bugfixes
+5 −0
Original line number Diff line number Diff line
@@ -82,6 +82,11 @@ FnordMetric.widgets.numbersWidget = function(){
          .attr('rel', vkey)
          .append($('<span class="desc">').html(vdesc))
          .append($('<span class="value">').html(0))

        if (opts.series_units[series]) {
          velem.attr("data-unit", opts.series_units[series]);
        }

        celem.append(velem);
      }

+4 −2
Original line number Diff line number Diff line
@@ -144,7 +144,9 @@ FnordMetric.util.updateNumbers = function(trgt_elem, diff_factor){
      if((diff > 0) && (new_val > target_val)){ new_val = target_val; }
      if((diff < 0) && (new_val < target_val)){ new_val = target_val; }
      $(this).attr('data-current', new_val);
      $('.value', this).html(FnordMetric.util.formatGaugeValue($(this).attr('rel'), new_val));
      var val_txt = FnordMetric.util.formatGaugeValue($(this).attr('rel'), new_val);
      if ($(this).attr('data-unit')){ val_txt += $(this).attr('data-unit'); }
      $('.value', this).html(val_txt);
    }
  });
  if(still_running){