Commit 58445c4b authored by Paul Asmuth's avatar Paul Asmuth
Browse files

fixed field_values_at, bar_widget

parent cc340569
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ TODO
- caching

- pie widget :)
- fix html, toplist, bar widget
- fix html, toplist
- timeseries-widget: cardinal on/off should be skeuomorph

- namespace picker in sidebar
+9 −2
Original line number Diff line number Diff line
@@ -62,13 +62,20 @@ module FnordMetric::GaugeCalculations

  def field_values_at(time, opts={}, &block)
    opts[:limit] ||= (opts[:max_fields] || 50)
    sync_redis.zrevrange(

    res = sync_redis.zrevrange(
      tick_key(time, opts[:append]), 
      0, opts[:limit]-1, 
      :withscores => true
    ).in_groups_of(2).map do |key, val|
      [key, calculate_value(val, time, opts, block)]
    end

    if res.first.is_a?(Array) && res.first.first.is_a?(Array)
      res[0]
    else
      res
    end
  end

  def field_values_total(time)
+2 −2
Original line number Diff line number Diff line
@@ -86,9 +86,9 @@ FnordMetric.widgets.barsWidget = function(){
        data: []
      }];

      if (values.length == 0) {

      if (values.length == 0)
        values.push(["No data yet",1]);
      }

      for(var n=0; n < values.length; n++){
        gconfig.series[0].data.push({
+1 −1

File changed.

Contains only whitespace changes.